AnsweredAssumed Answered

GetSelectedObjectsComponent Method Null for ReplaceComponents

Question asked by Ufuk Taskin on May 13, 2020
Latest reply on May 15, 2020 by Ufuk Taskin

Hi everyone,

I want to replace toolboxes with new components in the assembly file.

modelDocExt = swDoc.Extension;
int ToolType = modelDocExt.ToolboxPartType;
swSelMgr = (SelectionMgr)swDoc.SelectionManager;
if (ToolType == 1 || ToolType == 2)
{
     modelDocExt.ToolboxPartType = 0;
     kayityeri = Kayitdizin + Yenikodu[iz] + "." + uzanti;
     swDoc.SaveAs3(kayityeri, (int)swSaveAsVersion_e.swSaveAsCurrentVersion, (int)swSaveAsOptions_e.swSaveAsOptions_Silent);

     Component2 swSelComp = (Component2)swSelMgr.GetSelectedObjectsComponent(1);

     status = swAssy.ReplaceComponents(kayityeri, "", true, true);
}

But at line 10 is null (swSelComp)

can you help me about that issue

Outcomes