Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic Question

4 REPLIES 4
Reply
Message 1 of 5
SteveFrey
280 Views, 4 Replies

iLogic Question

I'm slowly learning iLogic and I'm confused on the basics.  I currently control several sketches of a frame generator assembly using the parameters in a dummy part file and this works perfectly.  The current calculations are pretty simple:  If the Overall Unit Width is 30" then the Door Width equals 28.5" or minus 1.5".   

 

Now I want to control two sketches (part files) from the assembly level using iLogic.  I've already named the parameters in the part files like door_width, door_height, unit_width, etc. 

 

What do I need to do in the part level to prepare these files for use in an iLogic assembly?

Steve Frey
Inventor 2021
Windows 10 Professional 64-bit
HP ZBook 17 G6
Processor: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 80 GB
NVIDIA Quadro RTX5000
3D Connexion SpaceMouse Wireless
4 REPLIES 4
Message 2 of 5
pcrawley
in reply to: SteveFrey

The good news is... You don't need to do anything!

 

If you just want to control those parameters from the parent assembly file, then all you do is add the part-name prefix in your code:

 

     Parameter("door_width") = 28.5

 

Becomes

 

     Parameter("Part_Name:1", "door_width") = 28.5

 

It's good practice to remove the ":1" from the instance name.  The reason is probably not applicable for what you are doing, but say the component you want to control is inserted multiple times in the assembly, then you delete the first instance.  Your iLogic code would stop working because it's looking for ":1" as part of the components name. 

 

The same syntax works for most things - like iProps:

 

    iProperties.Value("Project", "Part Number")

 

Just becomes

 

   iProperties.Value("part1:1", "Project", "Part Number")

 

Hope that helps.

Peter
Message 3 of 5
SteveFrey
in reply to: pcrawley

Thanks.  That makes it a little easier to understand.  Now to iLogic......

Steve Frey
Inventor 2021
Windows 10 Professional 64-bit
HP ZBook 17 G6
Processor: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 80 GB
NVIDIA Quadro RTX5000
3D Connexion SpaceMouse Wireless
Message 4 of 5
pcrawley
in reply to: SteveFrey

I'll keep promoting this site because there is so much useful iLogic information here. Plenty of examples and ready-to-use code:
inventortrenches.blogspot.co.nz/?m=1

Try and get a day of training with someone who knows iLogic - it'll be a great kick start - and help you learn good code habits - like adding plenty of comments.
Peter
Message 5 of 5
SteveFrey
in reply to: pcrawley

Thanks!  Much appreciated.

Steve Frey
Inventor 2021
Windows 10 Professional 64-bit
HP ZBook 17 G6
Processor: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 80 GB
NVIDIA Quadro RTX5000
3D Connexion SpaceMouse Wireless

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

Post to forums  

Autodesk Design & Make Report