iLogic to change a parameter and save as part

iLogic to change a parameter and save as part

autodesk_siva
Participant Participant
757 Views
2 Replies
Message 1 of 3

iLogic to change a parameter and save as part

autodesk_siva
Participant
Participant

Hi,

 

I have a family of parts in which the length of the part alone varies.

I would like to create all parts by ilogic rather than ipart.

The master model has been created with model parameter as "LENGTH"

 

Now, I want to write a rule to change the length of master model and save as with new name.

This operation should be repeated for incremental length of the master model.

 

Can anyone guide me how to do this..

 

Thanks in advance.

 

Regards,

Sivanantham. V

0 Likes
Accepted solutions (1)
758 Views
2 Replies
Replies (2)
Message 2 of 3

ThomasB44
Mentor
Mentor
Accepted solution

Hi Siva,

Something like this should help you :

 

SyntaxEditor Code Snippet

For LENGHT = 1 To 10
    
    Parameter("LENGHT") = LENGHT
    
    iProperties.Value("Summary", "Title") = "PART LG " & LENGHT & " mm"
    iProperties.Value("Project", "Part Number") = "PART" & LENGHT
    iProperties.Value("Project", "Description") = "PART" & LENGHT
    
    Dim Path, PartName, NewFileName As String
    Path = ThisDoc.Path
    PartName = ThisDoc.FileName
    NewFileName = Path & "\" & PartName & " LG " & LENGHT & ".ipt"
    
    ThisDoc.Document.SaveAs(NewFileName, True)
    
Next

 

Check here if you need some code :

 http://forums.autodesk.com/t5/inventor-customization/bd-p/120

 

Good luck,


Thomas
Mechanical Designer / Inventor Professional 2025
Inventor Professional EESignature

Message 3 of 3

ThomasB44
Mentor
Mentor

You should post this here :

http://forums.autodesk.com/t5/inventor-customization/bd-p/120


Thomas
Mechanical Designer / Inventor Professional 2025
Inventor Professional EESignature

0 Likes