forked from chuongmep/CadPythonShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetcolor.py
More file actions
27 lines (25 loc) · 804 Bytes
/
getcolor.py
File metadata and controls
27 lines (25 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import os
import math
clr.AddReference('acmgd')
clr.AddReference('acdbmgd')
clr.AddReference('accoremgd')
# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *
adoc = Application.DocumentManager.MdiActiveDocument
ed = adoc.Editor
## Get Color
import Autodesk.AutoCAD.Colors.EntityColor as cl
rgbcad = cl.LookUpRgb(111)
print(rgbcad)
blue = rgbcad & 255
green = (rgbcad >> 8) & 255
red = (rgbcad >> 16) & 255
print("Color RGB is", (red,green,blue))
## see more at : https://forum.dynamobim.com/t/aci-color-to-rgb/59856/6