AnsweredAssumed Answered

Custom Property from lightweight component vb.net

Question asked by Norbert Gal on Apr 13, 2017
Latest reply on Apr 18, 2017 by Norbert Gal

Hi,

 

I have an application, what traverse through an assembly's all subassemblies and parts, and I'd like to get custom info all of parts and assemblies.

My problem is, I can not get/set custom properties if a component is lightweight.

I've tried that to set lightweit components to resolve before I'd like to handle property, but in case of a huge assembly that takes very long time to finish the whole traverse.

 

I have a traverse function with a variable what contains a current component:

Comp As SldWorks.Component2

 

If I'm right, Ican only get/set custom properties in ModelDoc objects, so I get the Modeldoc the way below.

(confStr is a String what is declared previously)

 

Dim CompModel As SldWorks.ModelDoc2 = Comp.GetModelDoc2

If CompModel IsNot Nothing Then

   Dim PartNo As String = CompModel.GetCustomInfoValue(confStr, "PartNo")

End If

...

 

The problem is, if component is lightweight, CompModel will be Nothing.

 

Is there any other way to get/set component custom propertiesif it is in lightweight?

 

thank you

Outcomes