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.
Solved! Go to Solution.
Solved by MegaJerk. Go to Solution.
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!
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
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”.
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")