Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Cget subassembly civid3d

import clr

clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')

from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

def get_subassembly_info(subassembly):

	if not subassembly:
		return
	
	adoc = Application.DocumentManager.MdiActiveDocument
	output = []
	
	with adoc.LockDocument():
	    with adoc.Database as db:
	        with db.TransactionManager.StartTransaction() as t:
	            oid = subassembly.InternalObjectId
	            aeccSubassembly = t.GetObject(oid, OpenMode.ForRead)
	            aeccGenerator = aeccSubassembly.GeometryGenerator
	            output.append(aeccGenerator.MacroOrClassName)
	            output.append(aeccGenerator.ProjectOrAssemblyName)
	            t.Commit()
	            pass
	return output

OUT = get_subassembly_info(IN[0])
Comment

PREVIOUS NEXT
Code Example
Python :: python login to O365 
Python :: missing number 
Python :: Drawing rectangle with border only in matplotlib 
Python :: how ti maek a prinyt comnad i pyuthon 
Python :: pool does not print process id 
Python :: except Exception, e: suds python 
Python :: python read file to eof 
Python :: pybind11 python37_d.dll access violation 
Python :: bad resolution with df plot 
Python :: How to change the height of an input in python tkinter 
Python :: convert float to booelan 
Python :: how to define an empyt dic tin python 
Python :: perceptron multicouche scratch python 
Python :: pafy python documentation 
Python :: total keywords in python 
Python :: how to loadh5 file in python 
Python :: os.startfile on raspberry 
Python :: /usr/local/lib/python3.7/dist-packages/pytube/captions.py in xml_caption_to_srt(self, xml_captions) 
Python :: how to convert ui file to py file 
Python :: np.all() 
Python :: string -1 python 
Python :: python __dict__ 
Python :: TypeError: can only concatenate str (not "list") to str 
Python :: python string: .find() 
Python :: bounding box in pyplot 
Python :: how to check if a value is nan in python 
Python :: validate 
Python :: get dataframe name python 
Python :: python selenium print xpath of element 
Python :: numpy indexing 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =