Skip to content

Commit 25e52fb

Browse files
committed
add example
1 parent e00c04c commit 25e52fb

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

Script Examples/getcolor.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import clr
2+
import sys
3+
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
4+
import os
5+
import math
6+
clr.AddReference('acmgd')
7+
clr.AddReference('acdbmgd')
8+
clr.AddReference('accoremgd')
9+
# Import references from AutoCAD
10+
from Autodesk.AutoCAD.Runtime import *
11+
from Autodesk.AutoCAD.ApplicationServices import *
12+
from Autodesk.AutoCAD.EditorInput import *
13+
from Autodesk.AutoCAD.DatabaseServices import *
14+
from Autodesk.AutoCAD.Geometry import *
15+
adoc = Application.DocumentManager.MdiActiveDocument
16+
ed = adoc.Editor
17+
18+
## Get Color
19+
import Autodesk.AutoCAD.Colors.EntityColor as cl
20+
rgbcad = cl.LookUpRgb(111)
21+
print(rgbcad)
22+
blue = rgbcad & 255
23+
green = (rgbcad >> 8) & 255
24+
red = (rgbcad >> 16) & 255
25+
print("Color RGB is", (red,green,blue))

Script Examples/libcad.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import clr
2+
import sys
3+
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
4+
import os
5+
import math
6+
clr.AddReference('acmgd')
7+
clr.AddReference('acdbmgd')
8+
clr.AddReference('accoremgd')
9+
# Import references from AutoCAD
10+
from Autodesk.AutoCAD.Runtime import *
11+
from Autodesk.AutoCAD.ApplicationServices import *
12+
from Autodesk.AutoCAD.EditorInput import *
13+
from Autodesk.AutoCAD.DatabaseServices import *
14+
from Autodesk.AutoCAD.Geometry import *
15+
adoc = Application.DocumentManager.MdiActiveDocument
16+
ed = adoc.Editor
17+
18+
#Code Here :

Script Examples/pic/getcolor.png

117 KB
Loading

0 commit comments

Comments
 (0)