Skip to main content
Jun 5, 2020 1:40 PM UTC
Solved

Exporting STEP, Specifying a reference csys non interactively

My program involves automated configuration of assemblies.  I am exporting the results as STEP files using ProIntf3DFileWrite.   The 5th argument is reference Csys,  a ProSlection, This argument takes NULL for default csys, but I need a specific csys in my case for future assembly of the step file.    My program runs non-interactively, so there is no one selecting the csys.   I know the name of the Csys and have code where I am successfully finding and obtaining  the handle.    What I cannot seem to figure out is how to convert this csys handle to a Pro Selection.  Any ideas?   Thanks!

msteffkeAnswer
Jun 5, 2020 6:03 PM UTC

Yes I am converting to geomitem, but I was trying to use ProFeatureSelectionGet.   Not the right function for my situation.   I will try the ProSelectionAlloc that you suggest - fingers crossed!

3 replies

Jun 5, 2020 2:46 PM UTC

when you "find" the Csys in your code, do you find it as a ProCsys?

 

If so, you will need to convert it to a ProGeomitem beforehand. 

 

Something like this: 

 

 

 ProMdl model; // Get this with your code, or with "ProMdlCurrentGet(&model)";
 ProCsys csys; // Get this with your code somehow

 ProGeomitem csys_geomitem;
 ProCsysToGeomitem((ProSolid)model, csys, &csys_geomitem);

 ProSelection sel_geomitem;
 ProSelectionAlloc(NULL, (ProModelitem*)&csys_geomitem, &sel_geomitem);

 

 

Hope this helps!

 

Thanks, 

James Sullivan

msteffkeAuthorAnswer
Jun 5, 2020 6:03 PM UTC

Yes I am converting to geomitem, but I was trying to use ProFeatureSelectionGet.   Not the right function for my situation.   I will try the ProSelectionAlloc that you suggest - fingers crossed!