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: 

Inventor Properties Won't Update

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
256 Views, 4 Replies

Inventor Properties Won't Update

Okay...I give up...

What's wrong with the following code? I can't get the properties to update.

Thanks in advance.

--Randy

==========Begin Code Here==================

Private Sub cmdUpdateProps_Click()
'
'Display Name: Summary Information
'Internal name: {F29F85E0-4FF9-1068-AB91-08002B27B3D9}
'
'Display name: Document Summary Information
'Internal name: {D5CDD502-2E9C-101B-9397-08002B2CF9AE}
'
'Display name: Design Tracking Properties
'Internal name: {32853F0F-3444-11D1-9E93-0060B03C1CA6}
'
'Display name: User Defined Properties
'Internal name: {D5CDD505-2E9C-101B-9397-08002B2CF9AE}

' Declare the Apprentice object
Dim oApprentice As New ApprenticeServerComponent

' Open a document using Apprentice
Dim oApprenticeDoc As ApprenticeServerDocument
Set oApprenticeDoc = oApprentice.Open(lblFileName.Caption)

' Obtain the PropertySets collection
Dim oPropsets As PropertySets
Set oPropsets = oApprenticeDoc.PropertySets


' Summary Information

oPropsets.Item("{D5CDD502-2E9C-101B-9397-08002B2CF9AE}").ItemByPropId(kCompa
nyDocSummaryInformation).Value = "The ACME Company"

' Then FlushToFile to save properties
oPropsets.FlushToFile

oApprentice.Close
Set oPropsets = Nothing
Set oApprenticeDoc = Nothing
Set oApprentice = Nothing

End Sub
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

I ran your code, without any changes, and don't see any problems. After
running your program I can use Explorer and select iProperties from the
context menu for that file. On the Summary tab the Company field now has
"The ACME Company". So, your program updated the properties.

-Brian

"Randall A. Maxey" wrote in message
news:86EC4E4165FE52FCE3B3D9958CEDEE7D@in.WebX.maYIadrTaRb...
> Okay...I give up...
>
> What's wrong with the following code? I can't get the properties to
update.
>
> Thanks in advance.
>
> --Randy
>
> ==========Begin Code Here==================
>
> Private Sub cmdUpdateProps_Click()
> '
> 'Display Name: Summary Information
> 'Internal name: {F29F85E0-4FF9-1068-AB91-08002B27B3D9}
> '
> 'Display name: Document Summary Information
> 'Internal name: {D5CDD502-2E9C-101B-9397-08002B2CF9AE}
> '
> 'Display name: Design Tracking Properties
> 'Internal name: {32853F0F-3444-11D1-9E93-0060B03C1CA6}
> '
> 'Display name: User Defined Properties
> 'Internal name: {D5CDD505-2E9C-101B-9397-08002B2CF9AE}
>
> ' Declare the Apprentice object
> Dim oApprentice As New ApprenticeServerComponent
>
> ' Open a document using Apprentice
> Dim oApprenticeDoc As ApprenticeServerDocument
> Set oApprenticeDoc = oApprentice.Open(lblFileName.Caption)
>
> ' Obtain the PropertySets collection
> Dim oPropsets As PropertySets
> Set oPropsets = oApprenticeDoc.PropertySets
>
>
> ' Summary Information
>
>
oPropsets.Item("{D5CDD502-2E9C-101B-9397-08002B2CF9AE}").ItemByPropId(kCompa
> nyDocSummaryInformation).Value = "The ACME Company"
>
> ' Then FlushToFile to save properties
> oPropsets.FlushToFile
>
> oApprentice.Close
> Set oPropsets = Nothing
> Set oApprenticeDoc = Nothing
> Set oApprentice = Nothing
>
> End Sub
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

Uhhh...nevermind. I found my problem...stupid error on my part. I had the
file stored in two different locations and I was looking at the wrong file!
Arghhhh!

Delete this thread. Forget I ever said anything....(walking away
red-faced...)

Thanks for your help! 🙂
Message 4 of 5
rasmussen.egon
in reply to: Anonymous

Hi Randall

Seems your making some nice VBA.
Could you make a VBA that would change the field
"Part Number" in .ipt files in a certain subdir. ?.
The Part Number should be equal to filename.
If yes ? can I buy. ?


Thanks in Advance
Egon Rasmussen
Message 5 of 5
Anonymous
in reply to: Anonymous

Egon

Go to my web site and on the iCode page get iBatchRun.
http://www.mymcad.com/KWiK/mcad.htm
Then I will put a small macro in Customer files that you should be able to use along with
iBatchRun to do what you want.

It would probably be a lot more efficient to do it with Apprentice, but this way we don't
have to write the code to handle the file opening and closing.

If you want to buy.. then send Randall a 6 pack of his favorite refreshment since I took a
bit of his code to do it 8^)

--
Kent
Member of the Autodesk Discussion Forum Moderator Program


"sikamatec" wrote in message news:f12746a.3@WebX.maYIadrTaRb...
> Hi Randall
> Seems your making some nice VBA.
> Could you make a VBA that would change the field
> "Part Number" in .ipt files in a certain subdir. ?.
> The Part Number should be equal to filename.
> If yes ? can I buy. ?
>
>
> Thanks in Advance
> Egon Rasmussen
>

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

Post to forums  

Autodesk Design & Make Report