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: 

adding automatically sheet size per part in bill of material

5 REPLIES 5
Reply
Message 1 of 6
unisign10
909 Views, 5 Replies

adding automatically sheet size per part in bill of material

For my work I'm using the Export-Part-List option when I'm making a Drawing of a Assembly. This option becomes available when you open the part-list in a drawing of an assembly. When using this option, Inventor creates a CSV-file of the current assembly (ASSY1.IAM) which you can further use, for example, in a database. The database im using processes all the manually filled-in Iproperties (name, dimensions, material etc.) of the underlying parts (PART 1.IPT+ PART 2.IPT+ PART 3.IPT ) used by my assembly (ASSY1.IAM). My question now is whether it is possible (in addition to the Iproperties) to also automatically include the used paper size of each made drawing when converting my part list to a CSV-file instead of filling it in manually per part in the database. Note that i already created/made drawings of each of the underlying part (PART 1.IDW = A3; PART 2 = A1.IDW; PART 3.IDW = A2) of my assembly (ASSY1.IAM=A0) individually. I'm aware of the fact that option Export-part-list uses the manually filled-in Iproperties of the underlying parts (PART 1.IPT+ PART 2.IPT+ PART 3.IPT ) of the assembly (ASSY1.IAM), which you can also change indepentently in the overview: bill-of-materials; of the assembly. The macro name I found for the used paper format on the drawings is sheet size. What I would like for example, is to add a column in my part-list (in ASSY1.IDW) or in bill-of-materials (in ASSY1.IAM) , named for example: sheet size, showing the used paper format per part and then coverting the complete part-list to a CSV-file with the option Export-part-List. Hopefully I explained my problem well. I there someone who can help me with this problem? Regards Richard
5 REPLIES 5
Message 2 of 6
jtylerbc
in reply to: unisign10

The obvious problem with what you're trying to do is that the BOM / Parts List pull their information from the part's iProperties, while the drawing sheet size is a property of the drawing.  The part can't tell the BOM what sheet size the part's drawing uses, because it doesn't actually know.  You need a way for the drawing to tell the part what the sheet size is.

 

The easiest way to do that is probably going to be with some iLogic code.  It should be possible to write an iLogic rule (in the drawing) which looks at the sheet size and then copies that to a custom iProperty in the part.  Assuming you use one sheet per drawing file, and one part per drawing file, it might be as simple as this:

 

'Get the sheet size of the active sheet in the drawing
DrawingSheetSize = ActiveSheet.Size

'Find the first model document shown in a view in this drawing
ModelDoc = ThisDrawing.ModelDocument

'Try, Catch, End Try Error handling was added to prevent an error if the rule ran before views had been placed
Try
'Insert the drawing sheet size as a custom iProperty in the part file
iProperties.Value(ModelDoc.displayname, "Custom", "Sheet Size") = DrawingSheetSize

Catch

End Try

 

You would then just add the "Sheet Size" property to your parts list, and be good to go.  The rule would need to have a trigger set in the iLogic Event Triggers (on the Manage tab of the ribbon), probably using the "Before Save" trigger so that the sheet size will update every time the drawing is saved.

 

Hopefully that helps.  Note that I cranked this out pretty quickly, and didn't take a lot of time to check it for errors.  You'll want to make sure to test it  (or your own version if you write one) thoroughly before implementing it.

Message 3 of 6
unisign10
in reply to: jtylerbc

Thanks jtylerbc for the quick response! I have copy-clipped the iLogic code you have sended.Unfortunately the code doesn't work. The first commandline: DrawingSheetSize = ActiveSheet.Size turns yellow. I've tried to make some changes in the code, but I cant figure out what I'm doiing wrong since this is the first I'm working with visual basic. Any chance you can help me with this iLogic code? Regards Richard
Message 4 of 6
jtylerbc
in reply to: unisign10

Did you paste that code into an iLogic rule, or a macro in the VBA editor?

 

The code as-written needs to be in an iLogic rule - although it's probably possible to write a similar rule in VBA, the code I gave you is iLogic and won't run as VBA.

Message 5 of 6
JamieSENG
in reply to: unisign10

Was there a solution found for this. I'm also looking to have an ilogic rule fetch the sheet size to a custom iprop so it shows on are bom. Tried this code but it didn't work.
Message 6 of 6
JamieSENG
in reply to: JamieSENG

I dont is this still needed but ive been helped in achieveing in what i believe could be made to work for you to. You'll find details and an example of this on the discussion "dwg sheet size in custom model iprop" .

 

From what i read, your after it being on an assembly drawing parts list table which you then export? 

 

Hope you find what your after...

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

Post to forums  

Autodesk Design & Make Report