apprentice change display name / browser name

apprentice change display name / browser name

pawel.gromanski
Enthusiast Enthusiast
408 Views
3 Replies
Message 1 of 4

apprentice change display name / browser name

pawel.gromanski
Enthusiast
Enthusiast

Hi,

I'm trying to change iproperties and display/browser name of part or assembly (the one showing in model browser) using apprentice. Iproperties working fine but I can't change display name. Here's my code:

 

Dim apprentice As Inventor.ApprenticeServerComponent
apprentice = New Inventor.ApprenticeServerComponent

Dim apprenticeDoc As Inventor.ApprenticeServerDocument = Nothing

apprenticeDoc = apprentice.Open(FILE)
apprenticeDoc.PropertySets.Item("Inventor Summary Information").Item("Subject").Value = "value1"
apprenticeDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value = "value2"
apprenticeDoc.PropertySets.FlushToFile()

apprenticeDoc.DisplayName = "value3"
Dim oFileSaveAs As FileSaveAs
oFileSaveAs = apprentice.FileSaveAs
oFileSaveAs.AddFileToSave(apprenticeDoc, apprenticeDoc.FullFileName)
oFileSaveAs.ExecuteSave()

 

0 Likes
409 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Just a quick question...can you 'read' that DisplayName's value OK from Apprentice?  I know that DisplayName is normally Read/Write when accessed from Inventor, but I haven't tried changing that before from Apprentice, so I'm just curious whether it may simply be one of the things that is ReadOnly when accessed from apprentice, for some reason.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

pawel.gromanski
Enthusiast
Enthusiast

I tried reading display name. I can read original value then change it and read new value, I guess problem is saving changes.

I tried oFileSaveAs.ExecuteSaveCopyAs and I got new file with changed iproperties but display name was still the same.

0 Likes
Message 4 of 4

pawel.gromanski
Enthusiast
Enthusiast

Has anyone successfully changed and saved display name with apprentice? API help says it's Get/set value.

 

0 Likes