AnsweredAssumed Answered

Change custom property of a part in an assembly

Question asked by Jeroen Janssen Andeweg on Apr 10, 2014
Latest reply on Apr 10, 2014 by Jeroen Janssen Andeweg

This challenge is going on for days now and I can't get it the way I would like to see it.


I have an assembly. In a 'For - Next' I get the 'Childeren' as Component2. They can be parts or subassemblies.

I can determine what type of document the 'Child' is.


In these documents I have Custom Properties that I would like to change to a new value.


And this is where I get stuck. I have tried different things but am unsuccessful in 1 thing; I have to open the file to change the value of the custom properties and then close it.

Having an assembly of about 1000 parts makes it a disco on my screen and that is not what I want (I have past the disco stage for many years now).


I have tried my logic (which did not work obviously)

With Component2 I am unable to find something that allows me to change the custom property so I have to go to CustomPropertyManager


Dim FullFileNameofChild as String

FullFileNameofChild = "Child'.GetPathName

Dim MyActiveDoc as ModelDoc2

MyActiveDoc = swApp.ActivateDoc2(FullFileNameofChild, (Silent) True, (Error), DOC_ERROR (as Long))


Dim MyCustProp as CustomPropertyManager

MyCustProp = MyActiveDoc.Extension.CustomPropertyManager("") <<<<< this is where it goes wrong.


I do not have a clue why. In VB.NET I can select it and no errors occur untill debugging. I am thinking that ActivateDoc2 is not doing what I think it should do.


Can someone point me in the right direction please.


Much appreciated.