Hi Guys,
I am triying to remove object in corridor target.
Civil3DToolKit has the ability to add but do not remove (almost I couldnt get it).
In Civil3DToolKit node SubassemblyTargetInfo.SetTargets requiered Object, if I use anything else diferent to object warning is shown. There is a way to set none Object?
My second try was python. In my code I fuse one baseline and one region to try to remove object. But SubasemblyTargetInfro required ObjectIdCollection, I had read a lot post and forum about this but we cant create ObjectIdCollection. So when I run my code warning said
TypeError: expected SubassemblyTargetInfoCollection, got ObjectIdCollection
Any idea how to fix it?
coor = IN[0]
adoc = Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
# Place your code below
#
i=[]
TgtTds=[]
obj = coor.InternalObjectId
objid = t.GetObject(obj, OpenMode.ForWrite)
baseline = objid.Baselines[1]
region = baseline.BaselineRegions[0]
target = region.GetTargets()
for x in target:
CorTargetIds = x.TargetIds
CorTargetIds.Clear()
region.SetTargets(CorTargetIds)
# Commit before end transaction
t.Commit()
pass