Horje
Cget subassembly civid3d Code Example
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])




Python

Related
all python commands list and what they do Code Example all python commands list and what they do Code Example
stack widgets in tkinter Code Example stack widgets in tkinter Code Example
use regex python without re Code Example use regex python without re Code Example
how to get every character in a string python Code Example how to get every character in a string python Code Example
send command dynamo civid Code Example send command dynamo civid Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7