[Macro CATIA] identifier of view as parameter
[Macro CATIA] identifier of view as parameter
(OP)
Hi,
My question is : how to use the view identifier as parameter?
For example :
but how can i access to the view identifier, and use it as parameter?
thank you!
My question is : how to use the view identifier as parameter?
For example :
CODE -->
Dim DrwDocument As DrawingDocument
Set DrwDocument = CATIA.ActiveDocument
Dim iParameter As Parameter
Set iParameter = DrwDocument.Parameters.Item("Drawing\Sheet.1\ViewMakeUp.1\Scale")
MyText.InsertVariable 0, 0, iParameter but how can i access to the view identifier, and use it as parameter?
thank you!





RE: [Macro CATIA] identifier of view as parameter
RE: [Macro CATIA] identifier of view as parameter
Sorry, for me is not clear enough what you want to do.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: [Macro CATIA] identifier of view as parameter
CODE -->
Dim DrwDocument As DrawingDocument Set DrwDocument = CATIA.ActiveDocument Dim iParameter As Parameter Set iParameter = DrwDocument.Parameters.Item("Drawing\Sheet.1\ViewMakeUp.1\Scale") Call MyText.InsertVariable ( 0, 0, iParameter )RE: [Macro CATIA] identifier of view as parameter
use something like this
CODE -->
"MyText" is the text you want to insert the scale
"1 + Len(MyText.Text)" is the first character from which the parameter is inserted
RE: [Macro CATIA] identifier of view as parameter
CODE -->
Dim MyDoc As Document Set MyDoc = CATIA.ActiveDocument Dim MyDrawingDoc' As DrawingDocument Set MyDrawingDoc = MyDoc Call MyText.InsertVariable(1, 0, MyDrawingDoc.Parameters.GetItem("Dwg#"))"Dwg#" is the name of the parameter you want
RE: [Macro CATIA] identifier of view as parameter
imagine this scenario: if i add some caracters to the callout text "A" of the cut section for example, change it to "A12", and after that i try to change the name of the view "A-A", the callout text will not change, and it's a big problem!
one solution is to use:
CODE -->
Dim DrwDocument As DrawingDocument Set DrwDocument = CATIA.ActiveDocument Dim iParameter As Parameter Set iParameter = DrwDocument.Parameters.Item("Sheet.1\A-A\ViewName.1\ident") calloutText.InsertVariable 0, 0, iParameterbut this code doesn't work i dont know why...
AlexLozoya: thank you, but i want to use this parameter : Sheet.1\A-A\ViewName.1\ident
and it doesn't work ... can i serach it o something else ?
thank you
RE: [Macro CATIA] identifier of view as parameter
CODE -->
to answer caracters after the callout?(see response above)