Exporting Parameters into Drawings

Exporting Parameters into Drawings

ASchlaack
Collaborator Collaborator
912 Views
9 Replies
Message 1 of 10

Exporting Parameters into Drawings

ASchlaack
Collaborator
Collaborator

I've got a rather large assembly which has parameters that drives all of the parts within it. In my .idw I need to be able to get the parameters from the .iam so I can fill out my iproperties correctly. How can I do this? 

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Accepted solutions (1)
913 Views
9 Replies
Replies (9)
Message 2 of 10

MechMachineMan
Advisor
Advisor

By accessing the model and then accessing the parameters through that...?

As simple as it sounds.

 

Also:

api HELP.JPG


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 10

ASchlaack
Collaborator
Collaborator
That sounds simple, yes. But yet it doesn't work like that, I have tried everything from linking parameters to writing iLogic to autofill it.
Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 4 of 10

MechMachineMan
Advisor
Advisor
Have you correctly opened the assosciated models, and accessed the parameters in them through the API?

ie;

AssemblyComponentDefinition.Parameters

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 5 of 10

ASchlaack
Collaborator
Collaborator
Not using that code, how would I apply it?
Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 6 of 10

RodrigoEiras
Advocate
Advocate

 

Hi Aaron,

 

Another approach is to create an empty part that is linked to the Excel file and which is inserted in the assembly.

 

It must be defined in the assembly as a Phantom Part, as you don't want it to appear in the BOM.

 

Once you have that part you can easily access parameters from the assembly, and also from the drawings.

 

I hope it helps.

 

 

 

 

Rodrigo

0 Likes
Message 7 of 10

MechMachineMan
Advisor
Advisor
Not using what code and apply what?
What you said isn't very clear...

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 8 of 10

ASchlaack
Collaborator
Collaborator
I don;t understanding what you're saying to do in your last post.
Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 9 of 10

MechMachineMan
Advisor
Advisor
The only way I know is to write an iLogic program (using API help/vb.net) to open the assembly drawing and then pull/open a list of the parameters in a way that they are able to be formatted; ie an excel doc - so writing a program to open the linked excel doc like Rodrigo had mentioned would probably work best.

Otherwise, you could create new corresponding params in the .idw and write iLogic code to push them back to the assembly.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 10 of 10

rjay75
Collaborator
Collaborator
Accepted solution

Here's a method to use the parameters in an assembly to populate iProperties. If the parameters are numbers there's more you need to do to format the value. If you need to do that I give you a function to do that.

 

SyntaxEditor Code Snippet

IfActiveSheet.Sheet.DrawingViews.Count > 0 ThenSyntaxEditor Code Snippet
modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
dwgParam = Parameter(modelName, "d0")
iProperties.Value("Project", "Part Number") = dwgParam
'set more iproperties
End If

 

 

 

 

0 Likes