×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

[Macro CATIA] identifier of view as parameter

[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 :

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

(OP)
no one can help me this time ? :D

RE: [Macro CATIA] identifier of view as parameter

Try with this..

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

but.. if you want to put the scale on text..

use something like this

CODE -->

Call MyDrawingView.InsertViewScale(1 + Len(MyText.Text), MyText) 

"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

if you want to use a parameter you can use something like this ..

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

(OP)
ferdo:
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, iParameter 

but 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

(OP)
anyone know how to use :

CODE -->

String = "String to insert after"
MyTextRange.InsertAfter(String) 

to answer caracters after the callout?(see response above)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources