Skip to main content
1-Visitor
August 21, 2013
Question

How to identify the CSYS used in the Model thru J-Link

  • August 21, 2013
  • 1 reply
  • 3715 views

Hi,

 

I'm able to successfully list all the CSYS available in the Model using the J-Link API "Model.ListItems(ModelItemType.ITEM_COORD_SYS)".

 

But I'm unable to identify the CSYS used in the Model thru J-Link. Any leads on this is greatly appreciated.

 

Regards

Murari

1 reply

1-Visitor
August 21, 2013

Murari,

One way to do it is through interactive selection. Here is a section copied from the API wizard.

/*--------------------------------------------------------------------*\

Select a coordinate system. This defines the model (the top one

in that view), and the common attachments for the dimensions

\*--------------------------------------------------------------------*/

Session session = pfcGlobal.GetProESession ();

SelectionOptions selOptions =

pfcSelect.SelectionOptions_Create("csys");

selOptions.SetMaxNumSels (new Integer (1));

Selections selections = session.Select (selOptions, null);

if (selections == null || selections.getarraysize() == 0)

return;

/*--------------------------------------------------------------------*\

Extract the csys handle, and assembly path, and view handle.

\*--------------------------------------------------------------------*/

Selection csysSel = selections.get (0);

ModelItem selItem = csysSel.GetSelItem();

ComponentPath selPath = csysSel.GetPath();

View2D selView = csysSel.GetSelView2D();

Point3D selPos = csysSel.GetPoint();

if (selView == null)

throw new RuntimeException ("Must select coordinate system from a

drawing view.");

Model2D drawing = (Model2D)selView.GetDBParent();

Regards,

Jim

1-Visitor
August 21, 2013

Hello Jim,

Thanks for responding. Unfortunately, the requirement is to run this utility non-interactively on the 3D Model.

Please let me know if there are any work-around's to achieve this. I did not come across the relevant API but not sure if I'm missing anything here.

Regards

Murari

1-Visitor
August 21, 2013

Murari,

Actually, I have this exact same issue facing me at the moment. I am kind of hoping someone can help us out. If I find a solution, I will post it.

Regards,

Jim