Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Load TxPlanningObject from PmResourceLibrary into Graphic Viewer

Hello,

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.

Kind regards

2 REPLIES
Solution
Solution
Accepted by topic author RobSimCoder
‎08-26-2015 04:32 AM

Re: Load TxPlanningObject from PmResourceLibrary into Graphic Viewer

Hi!

 

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).

 

Best Regards,

 

Pim

Re: Load TxPlanningObject from PmResourceLibrary into Graphic Viewer

Hi Pim

 

Thank you so much! That works perfectly. I really appreciate it!

 

Kindest regards,

 

RobSimCoder