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 save as part number

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
Anonymous
2593 Views, 9 Replies

ilogic save as part number

Hi All

 

I am new to the forum, this is my first post.

I want to save a idw drawing file as the part number, of the part in the drawing sheet.

I have made a start on this but with no success as yet, this is what I have

ThisDoc.Document.SaveAs (iProperties.Value(("Project", "Part Number"(".idw"),True:)

 thought it would give you an idea of what I am trying to do.

The brackets got out of hand, yes I am new to the ilogic thing! Thanks

9 REPLIES 9
Message 2 of 10
Mark.Lancaster
in reply to: Anonymous

@Anonymous

 

If this iLogic snippet is located in your drawing file, then the information from Project/Part Number is coming for the drawing iProperties information and not from your part.  I assume you want to save the IDW based on the part properties that are in the base view of the drawing, is that correct?

 

You will need additional code to pull the information of the component off the base view.  Which will need VB programming commands...  I will tag @Curtis_Waguespack to see if he already has such a code.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

Message 3 of 10
Anonymous
in reply to: Mark.Lancaster

Thanks mark

 

Yep I want the part number from the part in the drawing sheet. I'm toggling through an I part table so I want to just run all rules then toggle to the next variation of the part and repeat . Thanks

Message 4 of 10
mcgyvr
in reply to: Anonymous


@Anonymous wrote:

Thanks mark

 

Yep I want the part number from the part in the drawing sheet. I'm toggling through an I part table so I want to just run all rules then toggle to the next variation of the part and repeat . Thanks


Any reason you need a separate drawing for each ipart? 

Can't you just do a tabulated drawing like this?

0208SolidEdge7



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 5 of 10
Anonymous
in reply to: mcgyvr

HI

 

All parts need a part number and separate drawing so we can vault everything and analyse costs automate production and most important of all,

its not up to me!.

any idea on the code?

Message 6 of 10
Curtis_Waguespack
in reply to: Anonymous

Hi J.Tofts,

 

Here's a quick example.

 

I didn't test it much (or at all with iParts), or try to catch any issues that might arise if for the part number iprop is empty, etc.

 

But it should get you started.

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

'get model doc
oModleDoc = ThisDrawing.ModelDocument

'process file name
'get  position of the last backslash
Dim FNamePos As Long 
FNamePos = InStrRev(oModleDoc.FullFileName, "\", -1)       
'get file name
Dim docFName As String 
docFName = Right(oModleDoc.FullFileName, Len(oModleDoc.FullFileName) - FNamePos) 

'define the property set
oDTPs = oModleDoc.PropertySets.Item("Design Tracking Properties")
'define the property
oPN = oDTPs.Item("Part Number").Value

'replace old file name with iproperty value
oPathAndName = Replace(oModleDoc.FullFileName,docFName,oPN) 
'save off a copy
ThisDoc.Document.SaveAs(oPathAndName & ".idw" , True)
'present message to user
MessageBox.Show("File saved to: " & oPathAndName & ".idw", "iLogic")
Message 7 of 10
Anonymous
in reply to: Curtis_Waguespack

Hi Curtis

 

Rule worked, Much appreciated

I have a couple of your books so to get my first problem solved by you is a good start to the day.

Can you recommend some literature for me to get to grips with the code side of inventor, I am currently building models with ilogic and all seems straight forward, its the curve ball element  when VB is required.is there a book of rules, yes I 'm old school I like the book element.

Again, Thank you so much. I really appreciate all your help.

 

Message 8 of 10
mcgyvr
in reply to: Anonymous


@Anonymous wrote:

HI

 

All parts need a part number and separate drawing so we can vault everything and analyse costs automate production and most important of all,

its not up to me!.

 


Not sure why those stated needs force you to a drawing for each member.. But whatever.. 

 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 9 of 10
Anonymous
in reply to: mcgyvr

Hi Mark

 

I do see the advantage of tables in drawing and appreciate the suggestion.

I am using Autodesk Inventor

  • On a GA drawing Will be a parts list of those parts in the GA
  • if a part is required for the GA then the part number is referenced to the drawing of the part with only that part on the drawing so as not to pick the wrong part out of the table
  • you can enter the part number in vault and retrieve the drawing
  • I.T will create a search program to auto retrieve a drawing pack for the GA

I know this sounds like a lot of messing around but our company makes a product with standard parts and part numbers which are also the drawing numbers. Once all part and assembly's are complete it will drastically reduce design time with ilogic driving the GA's

I hope this helps

 

Message 10 of 10
Anonymous
in reply to: Curtis_Waguespack

This code saves a copy of the drawing with the part number as file name. Is it possible to save the current idw drawing in the same way? (save, not save copy as)

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

Post to forums  

Autodesk Design & Make Report