File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ doc = Application .DocumentManager .MdiActiveDocument
16+ ed = doc .Editor
17+ db = doc .Database
18+ #Code Here :
19+ objects = []
20+ with doc .LockDocument ():
21+ with doc .Database as db :
22+ with db .TransactionManager .StartTransaction () as t :
23+ acblkbl = t .GetObject (db .BlockTableId ,OpenMode .ForRead )
24+ print (type (acblkbl ))
25+ acblktblrec = t .GetObject (acblkbl [BlockTableRecord .ModelSpace ],OpenMode .ForWrite )
26+ print (type (acblktblrec ))
27+ sel = doc .Editor .GetSelection ()
28+ if (sel .Status == PromptStatus .OK ):
29+ results = sel .Value
30+ for i in range (len (results )):
31+ if (results [i ] != None ) : objects .append (i )
32+ else : pass
33+ print ("Count Object Exploded:" ,len (objects ))
You can’t perform that action at this time.
0 commit comments