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!

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

Status
Not open for further replies.

CAD2015

Computer
Jan 21, 2006
1,932
US
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
 
Replies continue below

Recommended for you

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

- Romania
- EU
 
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
 
Ferdo,
How could I create the macro to renumber the constrains?
Can you direct the steps, please?

CAD 2015
 
You can try something like this:

Code:
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
- Curved text for Catia V5
 
Tesak,

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

CAD 2015
 
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
 
 http://files.engineering.com/getfile.aspx?folder=b37c9d8a-39be-4543-bf34-5d57a1e13d04&file=ENG-TIPS_1.docx
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
- Curved text for Catia V5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top