Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify 2D multiples headSymbol -CAT/VBA

Status
Not open for further replies.

Samrou

New member
Oct 4, 2018
1
TN
Hi ,
I'm created a macro that modify items dimension in 2D page(drafting) but What I couldn't achieve is to modify all headliner for the related items see image below
catdraw_bxmvb2.png


My code modify only 1 point :
Code:
 Dim myview As DrawingView

  Set myview = CATIA.ActiveDocument.Sheets.ActiveSheet.Views.ActiveView

  Dim mytext As DrawingText

  Set mytext = myview.Texts.Item(1)
  Dim myleader As DrawingLeader

  Set myleader = mytext.Leaders.Item(1)
  myleader.HeadSymbol = 0 ' this line is to modify the point as mentioned in the image
'the problem that this code is modifying only point and I want to modify multiple points


Anyone can light me on this ?
Please feel free to ask for clarification "My first post here "

B.R
S
 
Replies continue below

Recommended for you

Code:
Set mytext = myview.Texts.Item(1)

Gets the first element of the Texts collection.

so if you want to modify the second text, you should do

Code:
Set mytext = myview.Texts.Item(2)

once the first point is modified.

Or if you want to modify all points, you should loop and use something like this


Code:
 for i = 1 to myview.Texts.Count
[indent]Set mytext = myview.Texts.Item(i)
[...][/indent]
next



Eric N.
indocti discant et ament meminisse periti
 
I'm not sure if I understood you well, but I suppose you want to modify multiple text leaders. You would need to loop ".Texts" collection and modify each individual text leader. "Texts.Item(1)" means only one text, first text from ."Texts" collection.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top