Externally modify Additional Custom Model iProperty Source?

Externally modify Additional Custom Model iProperty Source?

Anonymous
Not applicable
1,489 Views
6 Replies
Message 1 of 7

Externally modify Additional Custom Model iProperty Source?

Anonymous
Not applicable

I asked this in the standard Inventor discussion group and was told I may have better luck here.

 

Is there a way to externally modify the Additional Custom Model iProperty Source in an .idw?

 

I'd like to be able to change the existing path without having to open the drawing.

 

I'd like to be able to do this to a single or a group of drawings.

 

Thanks,

Autodesk Inventor Professional 2009 SP2
Autodesk Productstream 2009
Intel i5 3.2GHz
7GB Ram
NVIDIA Quadro FX 1800

0 Likes
Accepted solutions (1)
1,490 Views
6 Replies
Replies (6)
Message 2 of 7

ekinsb
Alumni
Alumni

I'm not exactly sure what you mean by "Custom Model iProperty Source" but if it means working with the iProperties in a document you should find the information you need in one of the iProperty related posts on my blog.  The introductory article is here: http://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html.  And the link to the complete series is here: http://modthemachine.typepad.com/my_weblog/iproperties/.

If you mean redirecting someting in a drawing to reference another iProperty then I just need some more specific information about what you want to do.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks for the reply Brian.

 

I'm trying to externally modify the Additional Custom Model iProperty Source that is located in \Tools\Document Settings\ in the Drawing Tab, meaning I do not want to open each .idw file to modify this value.

 

Thanks,

Randy

0 Likes
Message 4 of 7

ekinsb
Alumni
Alumni
Accepted solution

OK.  Thanks for the explanation.  I understand now.  This setting is saved within each drawing document so each drawing will need to be opened, changed, and saved.  However you can automate this process.  Below is a simple VBA program that illustrates the process.  It will process all of the drawings in the specified directory.

 

Public Sub ChangeCustomerPropertySource()
    ' Set the path of the drawing documents to process, including the trailing backslash.
    Dim path As String
    path = "C:\Temp\"
   
    ' Iterate through the drawing documents in the specified path.
    Dim drawingFile As String
    drawingFile = dir(path & "*.idw")
    Do While drawingFile <> ""
        ' Open the drawing.
        Dim drawingDoc As DrawingDocument
        Set drawingDoc = ThisApplication.Documents.Open(path & drawingFile)
       
        ' Set the custom property source.
        drawingDoc.DrawingSettings.CustomPropertySourceFile = "C:\Temp\NewPart.ipt"
       
        ' Save the drawing.
        drawingDoc.Save
       
        ' Close the drawing.
        drawingDoc.Close
       
        ' Get the next drawing filename.
        drawingFile = dir
    Loop
   
    MsgBox "Finished."
End Sub


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 5 of 7

Anonymous
Not applicable

Thanks Brian!  That works great.

 

Can you help me understand how I could get it to check the drawing into Productstream once finished?

 

Randy

0 Likes
Message 6 of 7

ekinsb
Alumni
Alumni

I don't know much about the ProductStream API and can't be much help there.  I would try asking your question in the Autodesk Vault newsgroup.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 7 of 7

Anonymous
Not applicable

You've been a huge help Brian.

 

Thanks again.

 

Randy

 

0 Likes