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: 

Partslist export to DWG and PDF

4 REPLIES 4
Reply
Message 1 of 5
e.wiggers
831 Views, 4 Replies

Partslist export to DWG and PDF

Hello,

 

We are working with IV2012 and for a customer we have to generate about 1400 drawings. All these drawings we have to export to (Autocad) DWG and PDF format with the drawing number, revision, sheet size and name in the filename processed. All the parts and assemblies only have the part number as filename and this corresponds to the drawing file (idw) name. We dont want to change these basic filenames so i made a rule to export a assembly drawing and the part list, if present.

 

So far so good, the only problem I encounter is that I can't get the revision number outoff the iproperties from the right drawing. Say that if the assembly drawing has revision A, all the exported drawings from the part list get that revision number, even if they don't have a revision filled in. At first I export the main drawing, then test for a part list, if present, I loop through all the drawings in the part list, open them and export them to DWG and PDF. And that's the point where it is going wrong with the right revision number. It seems that the only iproperties I can approach are those from the main drawing, the file from where the rule is fired.

 

Can anybody help us with this problem, we have to export all these drawings at the end of this week.

 

Because the rule is pretty long I attached it.

 

Eelco Wiggers

Senior Engineer

 

Falcon engineers

The Netherlands

 

4 REPLIES 4
Message 2 of 5
zsc100
in reply to: e.wiggers

Hey, I know it may be a little late, but I am doing something similar.  I have had no problem getting the revision # from any and all different parts and assemblies in the drawing.  My script is used to export partslists and other iProperty information from IDWs.  Here is the way I select what IPT or IAM iProperties I'm going use:

-----------------------------------------------------

' Get the Documents collection object
Set invDocs = ThisApplication.Documents
' Iterate through the contents of the Documents collection.
For Each invDoc In invDocs
' Display the full filename of the document
ListBox1.AddItem (invDoc.FullFileName)
If Right(invDoc.FullFileName, 4) = ".ipt" Then
CountIPT = CountIPT + 1
UseModelIPT = IndexCounter
End If

If Right(invDoc.FullFileName, 4) = ".iam" Then
CountIAM = CountIAM + 1
UseModelIAM = IndexCounter
End If

IndexCounter = IndexCounter + 1
Next

-----------------------------------------------------

 

Then to select which ever file you want you simply set the correct invDocs.Item like this:

Set invDoc = invDocs.Item(UseModelIAM)

 

Then access the the rev # like this:

Set invDocProperty = invDoc.PropertySets.Item("Inventor Summary Information").Item("Revision Number")

UserForm1.TextBox5.Text = invDocProperty.Value

 

 

 

I really appreciate your code to check if a parts list is present or not.  I had spent hours trying to find a method to see if a parts list existed until I saw your error handler idea.  I hate having to use an error handler, but I'm convinced that may be the only way.

 

Thanks,

Zach

Message 3 of 5
xiaodong_liang
in reply to: zsc100

Hi,

 

I am just interested in jumping to discuss how to  check if a parts list is present or not. Error handle is OK, but I am not clear why you did not use PartLists.Count. If it is 0, that means no part list exists.

 

Probably what you want to check is if a specific part list exists in PartLists? In general, to check one specific item exists or not within a collection, the first we could think of is to check its name. However PartsList has no name. PartsList.Attribute may be useful if you attach some attribute with it already.

Message 4 of 5
zsc100
in reply to: xiaodong_liang

Thank you Xiaodong, that worked.  How could I have been aware of that function.  When I type

"If (invDoc.ActiveSheet." I would like to see a dropdown of all possible options, but that doesn't happen after ActiveSheet, I guess because the IDE doesn't immediately know what the active sheet could be, so it doesn't give me any options.  It would be nice if there was an easy one-stop-shop reference for stuff like this; maybe there is and I've just missed it?

 

Thanks again,, that is a much cleaner way to check for partslists.

 

Zach

Message 5 of 5
xiaodong_liang
in reply to: zsc100

Hi,

 

you meant the dropdown list of the propeties & methods of ActiveSheet does not appear? Any object of Inventor? It works well in my Visual Studio. I have no experience on this, probably you will need to consult with MSDN why this happened.

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

Post to forums  

Autodesk Design & Make Report