Home > Net >  Navisworks how to modify the element attribute problem
Navisworks how to modify the element attribute problem

Time:10-02

Increase the element properties, use "ComApi. InwGUIPropertyNode. SetUserDefined (0," UserDefine ", "UserPropn", Pvec);" Has been achieved, but how to modify an existing attribute, have a great god know? Looking for code reference,


Just like the code below:

Public void Modify_Propertys (ModelItem oEF, ComApi InwOaPropertyVec Pvec)
{
Try
{
ComApi. InwOpState9 oState=ComApiBridge. State;
ComApi. InwOaPath oPath=ComApiBridge. ToInwOaPath (oEF);
ComApi. InwGUIPropertyNode2 propn=(ComApi. InwGUIPropertyNode2) oState. GetGUIPropertyNode (oPath, true);

ComApi. InwGUIAttributesColl A=propn. GUIAttributes ();
ComApi. InwOaProperty C=(ComApi. InwOaProperty) oState. ObjectFactory (ComApi. NwEObjectType. EObjectType_nwOaProperty, null, null);

C.n ame="1";
C.U serName="2".
C. alue="https://bbs.csdn.net/topics/3";

Foreach (ComApi InwGUIAttribute B in A)
{
P. roperties (). The Replace (1, C);
}



Navisworks always return "no implemoned,"

Change Code to "p. roperties (). The Add (C)", can run, but no any happen in Navisworks.
  •  Tags:  
  • C#
  • Related