Publication and formula

Mauro MARTARELLO

Publication and formula
Hi,

starting from existing CATPart inserted inside CATProduct, I created symmetry CATPart with Symmetry command.

By CATScript, from existing CATPart, have been pasted with link some UserParameter and published them.

Unfortunatly, creating manually inside CATProduct two simple string parameters that are equal to published CATPart (existing and symmetry) UserParameter I obtain that, from existing CATPart formula is:

String.1 = `..!existing!BoundingBox`

but from symmetry CATPart formula is:

String.2 = `symmetry\External Parameters\BoundingBox`


If publication is made manually:

String.2 = `..!symmetry!BoundingBox`



Any idea on how obtain in symmetry CATPart correct publication ???


Thanks,
NervouS

Mike Berry

RE: Publication and formula
(in response to Mauro MARTARELLO)
I recently posted a couple of articles on my blog about how to develop names of parameters and objects for use in relations. One article covers how to do it when creating relations inside a part and the other deals with relations at the product level. I think these cover most cases and will probably answer your question. If not, just share what trouble you are having...

http://v5vb.wordpress.com/2010/05/11/developing-names-in-part-relations/
http://v5vb.wordpress.com/2010/05/24/developing-names-in-product-relations/

-Mike

Mauro MARTARELLO

RE: Publication and formula
(in response to Mauro MARTARELLO)
Hello Mike,

what I'm having is that the result of publications made by script is not the same of publications made by CATIA command!!!

I use this sintax to create publications:

Set oReference = oProd.CreateReferenceFromName(Product1.Name & "/!" & "BoundingBox")
Name = "BoundingBox"
Set oPoiPub = oPubs.Add(Name)
oPubs.SetDirect Name, oReference

I have read your post, but I didn't found something regarding publication...

Thanks,
NervouS

Mike Berry

RE: Publication and formula
(in response to Mauro MARTARELLO)
Sorry but I had trouble understanding your problem. If I understand correctly, you are having trouble creating a publication of that pasted parameter in the symmetry CATPart? ...I thought you had trouble making a formula at the product level referring to that publication.

In the code you posted, I don't see why you are trying to use a publication name to create your reference - you need to refer to the linked parameter inside that part. Also, I don't know what oProd is and what Product1 is in your code. I probably need to see more of your code than what you posted but in general I think you should be doing something like this,

Set oReference = oProd.CreateReferenceFromName("symmetry\External Parameters\BoundingBox")

Try recording a macro of yourself making that publication and look at what you get.

-Mike

Mauro MARTARELLO

RE: Publication and formula
(in response to Mauro MARTARELLO)
...resolved!!!

the sintax of publication was wrong!


thanks again Mike for your help.

NervouS