Need a little help here.. I wrote this beautiful code only to find out that very last step, Autodesk has not allowed me a function is really need.
My work around is to “SendStringtoExecute”, yes I know….... Please don’t give me crap about it.
My issue is that I need Autocad to select an item similar to a PromptEntity routine, but without the user actually selecting it. For example, is there a way for an ObjectId to be passed into the selection. I would then run the SendStringtoExecute. I thought SetImpliedSelection would work, but I cannot get that to work, something about a one-dimensional array… will look into.
Troy Moore, PE
Civil 3d 2014
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Thanks for looking at....
'Network
Dim oStructureIds As ObjectIdCollection = Network.FindShortestNetworkPath(mystartstructureid, myendstructureid, 0)
'Add Pipes to profile view
For Each oid As ObjectId In oStructureIds
If oid.ObjectClass.DxfName = "AECC_STRUCTURE" Then
Dim oStructure As Autodesk.Civil.DatabaseServices.Structure = trans.GetObject(oid, OpenMode.ForWrite)
'PROBLEM HERE myEd.SetImpliedSelection(oid)
'TRY....STILL PROBLEM HERE myEd.SetImpliedSelection(oStructure.ObjectId)
' Add to structures profile view
myDocument.SendStringToExecute("AddNetworkPartsToProf S 100000.00000000,100000.00000000 101000.00000000,101000.00000000", True, False, False)
End If
Next
Both the Structure and Pipe objects have the AddToProfileview method, no need to invoke the command with SendStringToExecute...
Dim oStructureIds As ObjectIdCollection = Network.FindShortestNetworkPath(mystartstructureid, myendstructureid, 0) 'Add Pipes to profile view For Each oid As ObjectId In oStructureIds If oid.ObjectClass.DxfName = "AECC_STRUCTURE" Then Dim oStructure As Autodesk.Civil.DatabaseServices.Structure = trans.GetObject(oid, OpenMode.ForWrite) oStructure.AddToProfileView(oProfileViewId) End If Next
Also, there is a customization forum specifically for the Civil3D API's. You might find it useful to visit & post over there in the future.
Sorry. I have been meaning to reply back to this. You are dead on with the fix. I somehow missed it. Thanks a bunch !
Troy.
Can't find what you're looking for? Ask the community or share your knowledge.