Reply

Change Properties without opening occurrences

[ Edited ]

Hi, 

I want to change the properties of the part files (occurrences) contain in the assembly without opening the part files.

Currently, I am opening individual part files and changing the properties. But it is taking lot of time as have around 25-30 parts in assembly.

Is there is any way to change the properties of the parts (occurrences) while working in assembly environment?

I want to change to change “Custom” properties and “Material”.

 

 

Posted by: Prasad Pawar
Post date: 9/5/2008 6:28:01 PM

4 REPLIES

RE: Change Properties without opening occurrences

[ Edited ]

Hi Prasad,

 

if the parts have not been activated you can probably change them with the file properties API (haven't tested this but it should work). You will, however, get an error if the part is open/activated. In this case you'll have to fall back to using the OccurrenceDocument.Properties member (if you use this on an inactive part it will be activated after the call).

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 9/5/2008 8:49:59 PM

RE: Change Properties without opening occurrences

[ Edited ]

 

Hi Prasad, 

Try this little puppy. Been a while since i have used it but good luck...PS the help doesn't work

Spot ya Snow

 

Posted by: Snow Mackenzie
Post date: 9/6/2008 11:41:07 AM

RE: Change Properties without opening occurrences

[ Edited ]

 

hi,

i tried it using OccurrenceDocument and it is working good. But i have a small query. When i save and close the assembly, the properties do not get updated to part, parts get their old properties.

 

Any suggetion in this regards?

 

Posted by: Prasad Pawar
Post date: 9/9/2008 6:00:35 PM

RE: Change Properties without opening occurrences

[ Edited ]

 

Try something like this

    Dim objProps As SolidEdgeFileProperties.PropertySets

    Dim Filepath As String

 

 Filepath = objOccurrence.OccurrenceFileName

Set objProps = CreateObject("SolidEdge.FileProperties")

objProps.Open Filepath

 objProps.Item("Custom").Item("Part Name").Value = "Something"

objProps.Save

objProps.Close

 

Set the 'Solid Edge File Properties Object library' in the VB references

This is in VB6 sorry as i don't have .net

Good Luck

Snow

 

 

Posted by: Snow Mackenzie
Post date: 9/10/2008 1:11:56 AM