Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ThisDoc.Document.SaveAs error

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
2119 Views, 4 Replies

ThisDoc.Document.SaveAs error

Hi, this is propably really easy, but I keep getting the error;

 

Rule Compile Errors in Rule2, in V CHAIR_Assembly.iam

Error on Line 13 : 'NewAssembly' is not declared. It may be inaccessible due to its protection level.

 

My code is

 

T = 30

Parameter("V CHAIR_backrest:1", "thickness") = T
Parameter("V CHAIR_backsupport:1", "thickness") = T
Parameter("V CHAIR_backsupport:2", "thickness") = T
Parameter("V CHAIR_leg:1", "thickness") = T
Parameter("V CHAIR_leg:2", "thickness") = T
Parameter("V CHAIR_rib:1", "thickness") = T
Parameter("V CHAIR_rib:2", "thickness") = T
Parameter("V CHAIR_rib:3", "thickness") = T
Parameter("V CHAIR_seat:1", "thickness") = T

ThisDoc.Document.SaveAs(NewAssembly.iam,True)

 

Any help would be much appreciated.

4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Just to add, this is a simplified version of the code. Multiple files will be generated from the dynamic variable T.
Message 3 of 5
rossano_praderi
in reply to: Anonymous

Hi, i think this can be your solution:

 

NewFileName = ThisDoc.Path & "\" & "NewAssembly.iam"

ThisDoc.Document.SaveAs(Newfilename,True)

 

Bregs

Rossano Praderi

 



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Tags (2)
Message 4 of 5
Anonymous
in reply to: rossano_praderi

Thanks, that worked, so the command is looking for the entire file path not just actual file name, I assumed it would just drop it into the working directory.

Cheers,

Harry
Message 5 of 5
rossano_praderi
in reply to: Anonymous

You are welcome.... Smiley Happy



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report