I want to be able to load multiple Guns into the Graphic Viewer from the ResourceLibrary on selection. Basically I cannot find a link between the planning data (TxPlanningObject) and loading this data into the graphic viewer i.e TxGun. Idealy I would like to do this without worrying about a study but if this is not possible that is also ok.
So far I have the following code:
Dim resLibPlanObj As TxPlanningObject = TxApplication.ActiveSelection.GetPlanningItems.Item(0) If resLibPlanObj.PlanningType.Equals("PmResourceLibrary") = True Then For Each item As TxPlanningObject In TxEmsTraversalManager.GetAllDescendants(resLibPlanObj) If item.PlanningType = "Gun" Then 'At this point I would like to load each gun into the Graphic Viewer End If Next Else End If
Thanks in adavance.
Solved! Go to Solution.
Look into ITxComponentCreation -> InsertComponent Method, It derives from ITxObject. For the implementation of the InsertComponent method look at TxInsertComponentCreationData, this class has a link with your TxPlanningObject (propertie).