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: 

ilogic iproperties

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
DJFore
1256 Views, 4 Replies

ilogic iproperties

I have searched the discussion groups for help on this but do not see anything so here is what I am needing. I have a drawing template that is pulling the part number from a part (Properties-Model, Part Number) and a drawing number from (Properties-Drawing, Part Number). When I place this drawing (idw) into vault the part number from the part does not carry through it will only pull my drawing number, so I would like to setup a custom iproperty (DWG PART NUMBER) in my idw file that will be filled in based on the part number from the model. I know how to create the custom iproperty and how to map it to vault I just do not know how to look at the part number of a part on a drawing and pull information from it.

A couple of quirks:

First some idw's will be parts some will be assemblies.

Second I want to use this ilogic code in my template so I want to be able to place in any view and it recongnize what that parts Part Number is and place it in the custom iProperty DWG PART NUMBER

 

Background: I use a different Drawing No. on my drawing then my Part Number because I may have multiple drawings with different manufacturing methods for the same part number (different Bom's, machining procedures or welding options)

 

I have attempted this several different ways but cannot seem to pull in the information from a view on my drawing any suggestions would be appreciated.

4 REPLIES 4
Message 2 of 5
MegaJerk
in reply to: DJFore

You’ll need to have a Text parameter (in this case named ‘FileName’) in order for this example to work.

Make a rule in your drawing, and replace the information with the pages / views that point to the part in question.

 

FileName = IO.Path.GetFileName(ThisDrawing.Sheet("Production Drawing:1").View("1").ModelDocument.FullFileName)

 

 

In the instance above, I am looking at the Drawing Sheet (page) “Production Drawing” and the part view 1 (which is what that part’s View Identifier is).

 

I hope this helps!



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 3 of 5
DJFore
in reply to: MegaJerk

Well that pulls in the file name quite well but what I really need to do is pull in the Part Number iProperty in the model file.

I need to extract that information out so that I can use it in the custom iProperty in the idw file

Message 4 of 5
MegaJerk
in reply to: DJFore

iProperties.Value("Custom", "Part Number") = iProperties.Value(FileName, "Custom", "Part Number") 

 Sorry!

 

Assuming that you already have a Custom iprop (in your drawing) named "Part Number" as well as a custom iprop on that part named "Part Number", it should replicate it across both. Of course this will only work with the part file name that FileName is grabbing.

 

 

 

Is this more in the ways of what you'd like to do?

 

 

*EDIT*

You can specify the type of iproperty that it’s calling by replacing “Custom” with whatever tab you want to access. Perhaps you’d like to use the iprop Part Number from the Project tab. In that case simply replace “Custom” with “Project”.



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 5 of 5
DJFore
in reply to: MegaJerk

 

So this is what I ended up with that works perfectly this will allow me to pull this information into vault (map it) so I can search it. Here is the code I used for anyone else out there
FileName = IO.Path.GetFileName(ThisDrawing.Sheet("sheet:1").View("VIEW1").ModelDocument.FullFileName)
iProperties.Value("Custom", "DWG Part Number") = iProperties.Value(FileName, "Project", "Part Number")

 

 

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

Post to forums  

Autodesk Design & Make Report