×
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

Catia Product constrains numbering order......
2

Catia Product constrains numbering order......

Catia Product constrains numbering order......

(OP)
Hi,

When I add constrains into a Product, sometimes the numbering do not starts from 1 (please, see the attached picture).
How could I correct that?

CAD 2015

RE: Catia Product constrains numbering order......

Hi,

No attached picture. Anyway, that means you already put some constrains and deleted before, CATIA is keeping the counter in memory, doesn't meter if you don't see them. You will need a macro to renumber them (I don't remember if v6 knows to renumber but I believe yes, it has this functionality without any macro)

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: Catia Product constrains numbering order......

(OP)
Thanks Ferdo.
I think that my company placed a filter.
Or my account has problem........
I did download a picture! I can't upload any image anymore!

CAD 2015

RE: Catia Product constrains numbering order......

(OP)
Ferdo,
How could I create the macro to renumber the constrains?
Can you direct the steps, please?

CAD 2015

RE: Catia Product constrains numbering order......

You can try something like this:

CODE --> vba

Sub Main()
    Dim doc, prod, constr, i

    Set doc = CATIA.ActiveDocument
    Set prod = doc.Product
    Set constr = prod.Connections("CATIAConstraints")
    
    For i = 1 To constr.Count
        constr.item(i).Name = "Fix." & i
    Next
End Sub 

Tesak
http://scripts4all.eu/txtoncurve/ - Curved text for Catia V5

RE: Catia Product constrains numbering order......

(OP)
Thanks Tesak!

CAD 2015

RE: Catia Product constrains numbering order......

If this is the most of your worries... he he

RE: Catia Product constrains numbering order......

(OP)
Tesak,

Your script didn't work........

CAD 2015

RE: Catia Product constrains numbering order......

I have tested it and it is working, so something is wrong on your side. Share your code and we can check it.

Tesak
http://scripts4all.eu/txtoncurve/ - Curved text for Catia V5

RE: Catia Product constrains numbering order......

All scripts must contain CATMain function as a starting point. Rename Main into CATMain and it will work.

Tesak
http://scripts4all.eu/txtoncurve/ - Curved text for Catia V5

RE: Catia Product constrains numbering order......

(OP)
It works, but see the attached file.
It is curious, all constraints have been converted in "Fix" one....

I used this script:

Sub CATMain()
Dim doc, prod, constr, i

Set doc = CATIA.ActiveDocument
Set prod = doc.Product
Set constr = prod.Connections("CATIAConstraints")

For i = 1 To constr.Count
constr.item(i).Name = "Fix." & i
Next
End Sub

CAD 2015

RE: Catia Product constrains numbering order......

I gave you this code just as an example how to get a contraints collection. Of course renaming algorithm has to be changed according your needs. You have to count number of contraints of a specific type and replace existing numbering with desired one.

Tesak
http://scripts4all.eu/txtoncurve/ - Curved text for Catia V5

RE: Catia Product constrains numbering order......

(OP)
OK, thanks!

CAD 2015

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