Catia FAI balloon renumber
Catia FAI balloon renumber
(OP)
Hi all
I'm working in the aerospace, and using CATIA v5-6r2014. I had receiveda some very complex parts, that I need to create the FAI and the ballooned 2D drawings, for the FAI every measured value need's to be ballooned.
Some time I realise that I missed one and start to renumber all the balloons manually.
Is there other resonamble way to renumber all the balloons starting from one up
A macro an catia option or something
PS for my catia I have vbs v5
Thank you all in advance.
I'm working in the aerospace, and using CATIA v5-6r2014. I had receiveda some very complex parts, that I need to create the FAI and the ballooned 2D drawings, for the FAI every measured value need's to be ballooned.
Some time I realise that I missed one and start to renumber all the balloons manually.
Is there other resonamble way to renumber all the balloons starting from one up
A macro an catia option or something
PS for my catia I have vbs v5
Thank you all in advance.





RE: Catia FAI balloon renumber
it is quite easy, try this small script and modify it according your needs:
CODE --> vbs
Sub CATMain() Dim doc, myview, mytexts, txt, i, baloon Set doc = CATIA.ActiveDocument Set myview = doc.Sheets.ActiveSheet.Views.ActiveView Set mytexts = myview.Texts i = 0 For Each txt In mytexts If txt.FrameType = 53 Or txt.FrameType = 3 Then txt.Text = i i = i + 1 End If Next End SubFrame type value 3 and 53 stand for catCircle and locked catCircle.
Tesak
http://scripts4all.eu/txtoncurve/ - Text along a curve for Catia V5
RE: Catia FAI balloon renumber
CODE --> VBS
Sub CATMain() Dim doc, myview, mytexts, txt, i, baloon, baloonno, number Set doc = CATIA.ActiveDocument Set myview = doc.Sheets.ActiveSheet.Views.ActiveView Set mytexts = myview.Texts number = InputBox("test","test","0") baloonno = number+1 For Each txt In mytexts If txt.FrameType = 53 Or txt.FrameType = 3 Then If txt.Text => number Then txt.Text = baloonno baloonno = baloonno + 1 End If End If Next MsgBox(number) End Subif i enter a number between 1-9 the code makes the gap but stops to renumber at 10 and above
if i enter a number grater then 10 it leaves balloon 1 but renumber all balloons staring fro, my input
what i'm doing wrong
RE: Catia FAI balloon renumber
indocti discant et ament meminisse periti
RE: Catia FAI balloon renumber
it seams like the code is working until he tries to compare values greater then 10
when check's if 10 > 5 i think he consider just the first digit 1 > 5 and skips
RE: Catia FAI balloon renumber
you should find some CInt...
indocti discant et ament meminisse periti
RE: Catia FAI balloon renumber
Eric is right as usual. Maybe you want to try something like this.
CODE --> catvbs
Sub CATMain() Dim doc, myview, mytexts, txt, i, baloon, baloonno, number Set doc = CATIA.ActiveDocument Set myview = doc.Sheets.ActiveSheet.Views.ActiveView Set mytexts = myview.Texts number = InputBox("Start with what number you want first in the active view","Input start number","1") For Each txt In mytexts If txt.FrameType = 53 Or txt.FrameType = 3 Then If Cint(txt.Text) <= number Then txt.Text = number number = number + 1 ElseIf Cint(txt.Text) >= number Then txt.Text = number number = number + 1 End If End If Next End SubRegards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Catia FAI balloon renumber
CODE --> vba
as something like text = number is reminding me about apples and oranges.
indocti discant et ament meminisse periti
RE: Catia FAI balloon renumber
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Catia FAI balloon renumber
The problem is, what if i need to renumber middle baloon?
1
2
3
4
need to add 2 items here to be number 5 and 6
5
6
7
So the code should say, if the number is greater than 4 you add N position of your choosing. In our case let's say 2 since i added 2 pieces.
But if it is smaller leave baloon as it is, so at the final result i shoul have.
1
2
3
4
5<new
6<new
7<old 5 became 7
8<old 6 became 8
9<old 7 became 9
I tryed to edit the code, but i think i'm missing something basic.
I tryed to tell the software if Cint(txt.Text) is greater than 4 add 2, but it seems it will run without operations.
Maybe because the Cint(txt.Text) is also used for cycling the for loop.
Thanks!
RE: Catia FAI balloon renumber
you have 1,2,3,4,5,6,7 and you want to insert X new after 4
you need to ask user where to insert (A) and also how many (B) .
then you check all balloon, if number bigger than A then change its number X to new value X+B
with A=4 and B = 2 you will have 1,2,3,4,7,8,9
your script should now create the missing balloon.
create loop i of B cycles, ask user to activate a view in which the balloon A+i(B) should be created and indicate location, then create balloon with proper number in new active view at location, cycle...
This will finally gives you 1,2,3,4,5,6,7,8,9
indocti discant et ament meminisse periti