Access FeatureLine using COM

Access FeatureLine using COM

Yonas89
Collaborator Collaborator
6,844 Views
20 Replies
Message 1 of 21

Access FeatureLine using COM

Yonas89
Collaborator
Collaborator

Hello,

 

I'm trying to access feature line with python, but my main obstacle is the lack of knowledge of COM. I need to check if my selected object is a feature line. I don't know what property i need to use. Is there anyone who can help to fix this snippet of my code?

 

app = System.Runtime.InteropServices.Marshal.GetActiveObject("Autocad.Application")
	CivilApp = app.GetInterfaceObject("AeccXUiLand.AeccApplication.12.0")
	AecDoc = CivilApp.ActiveDocument
	AecDB = AecDoc.Database
	sset = AecDoc.PickfirstSelectionSet
	n = sset.Count	
	for i in range(n):
		if  sset.Item(i).Name == "AeccLandFeatureLine"

 

0 Likes
6,845 Views
20 Replies
Replies (20)
Message 21 of 21

Yonas89
Collaborator
Collaborator

@Anonymous ,

 

the script should work fine. First of all what I see, your python node has only 1 input so make sure it has 2, because script has IN[0] and IN[1], so that's 2 inputs. Secondly maybe you forget to select the flines in Civil 3D? Note that is only working with active selection set, so you have to select flines first and then transfer to Dynamo Studio and run the script. Also, maybe your Civil 3D is installed into custom location, so make sure that paths in the script to dll's are provided correctly.

At last are you using Dynamo (which means opening from Revit) or Dynamo studio, which is stand alone application? I'm not really sure if this might be the case, but if it still not working, make sure you're using Dynamo studio.