I'm writing a journal that will essentially "wipe a titleblock clean" in the case I am doing a quick Save As of an existing cad file. I need to figure out a way to delete everything on layer 249 in a journal. Any ideas?
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
dim objs as NXObject()=workpart.layers.getallobjectsonlayer(249)
for i as integer = 0 to objs.length-1
ufs.modl.obj.deleteobject(objs(i).tag)
next
Joe,
Thanks for the help. I already had 'Imports NXOpen' as a line so I added 'Imports NXOpen.UF' below that. That seems to have eliminated the 'UFSession' not defined error.
Now the error I see reads: 'obj' is not a member of 'NXOpen.UF.UFModl' This pertains to the following line: ufs.modl.obj.deleteobject(objs(i).tag) Any ideas?