I am trying to create publications on geometry in a part with VB. So, I have many instances of a particular UDF (User Defined Feature) and I want to publish the same output from each UDF instance. Of course, each UDF has the exact same output names too. The problem is how to build a reference for each element to be published when the element names are the same.
...At first, I used the CreateReferenceFromObject method on the part to make a reference and pass that it to the Publications.SetDirect method. Yeah, it didn't like that. So then I figured maybe you have to create the reference from the product object, so I tried using the CreateReferenceFromName method on the product object (This is the only way to make a reference from the product). The problem here is what to pass for the iLabel argument?
If you use the record mechanism to get the correct syntax, it only seems to care about the part and the element name when it develops the label. For example, if I have 3 UDF's in Geometrical Set.1 in Part1 and I want to publish the output called Line_X from each of the UDF instances, it will record the exact same label when developing all 3 references,
Set reference1 = product1.CreateReferenceFromName("PART1 /!Line_X"
Set publication1 = publications1.Add("AP1"
publications1.SetDirect "AP1", reference1
I tried going in and manipulating the label many times to do something like this,
Set reference1 = product1.CreateReferenceFromName("PART1 /Geometrical Set.1/UDF.1/!Line_X"
Nothing seems to work. It ignores you and always locates the part and finds the first element in the part with that name.
Anybody know how to publish multiple elements having the same name?
-Mike
|