Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

VB API : RemoveObjects( )

Arno

New member
Hello all,


I realy starting to make good use of the VB API for ProE WF4, but there is one thing i want to use now and i can't seem to get it working.


Usualy after working with files, i use the pfcServer.RemoveObjects() method toremove all files from the workspace i just needed. I then use as argument 'Nothing' so that all files are removed.


Now i have to only delete specific files, but the argument has to be an Object (not a string like Filename). So i kind of figured out it has to be in e StringSequence. This works for 1 filename, but i get the pfcExceptions::ToolKitNotFound error when i 'StringSeq.Append' more filenames in the array.


anyone has an idea how to remove specific number of files from the workspace?





so far:


Dim strS As Istringseq


strS = New Cstringseq


strS.Append(partname)


serv.RemoveObjects(strS)
 
and as usual, once i post something the answer gets to me...


i had to use the Fullname "instancename<genericname>.prt"


when 1 of the names in the stringsequence is wrong, the entire action gets cancelled. so the Stringseq.append works :)
 
Arno,


You can create a list of all files you want to remove and then run a loop to remove each of the from list individually.


HTH
 

Sponsor

Articles From 3DCAD World

Back
Top