cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

[Toolkit] Xsection in Drawing View

Shu-FanWang
1-Visitor

[Toolkit] Xsection in Drawing View

Hi~All,


We are trying toset section options in drawing view with Toolkit, but can't find any direct API for this.


Does anyone know how to set section options in drawing view?


Anysuggest will be fully appreciated~



Thanks a lot


Shu-Fan


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
6 REPLIES 6

tkuse.pdf - page 1085


Sections of a View


Functions Introduced:


• ProDrawingViewSectionTypeGet()


• ProDrawingView2DSectionGet()


• ProDrawingView2DSectionSet()


• ProDrawingView2DSectionNumberGet()


• ProDrawingView3DSectionGet()


• ProDrawingView3DSectionSet()


• ProDrawingViewSinglepartSectionGet()


• ProDrawingViewSinglepartSectionSet()


This what you are looking for?

Hi~Yaroslav,


Thanks for your quick reply,


That is what we needed, but with some problem.


Due to some of our customers still using WF4, we are using WF4's APIs. (sorry, it's my fault, not checking higher versions...)


Those APIs are new introduced in Creo/Elements, is there any way to doing this in WF4? or ways to instead?



The worst case, we plan to use ProMacro() toreplace those APIs.


But facing another problem, we can't auto select drawing view after ProDrawingGeneralviewCreate() to let the ProMacro() start.


(ProMacro() start with right mouse button click to open menu)


Is there any way to auto select drawing view?



Thanks a lot


Shu-Fan

Hello!


I'm not sure, but you can try


Add the view to selection, then Selection -> Highlighting


Functions Introduced:


• ProSelectionHighlight()


• ProSelectionDisplay()


• ProSelectionUnhighlight()



In Reply to Shu-Fan Wang:



Hi~Yaroslav,


Thanks for your quick reply,


That is what we needed, but with some problem.


Due to some of our customers still using WF4, we are using WF4's APIs. (sorry, it's my fault, not checking higher versions...)


Those APIs are new introduced in Creo/Elements, is there any way to doing this in WF4? or ways to instead?



The worst case, we plan to use ProMacro() toreplace those APIs.


But facing another problem, we can't auto select drawing view after ProDrawingGeneralviewCreate() to let the ProMacro() start.


(ProMacro() start with right mouse button click to open menu)


Is there any way to auto select drawing view?



Thanks a lot


Shu-Fan


FV
17-Peridot
17-Peridot
(To:Shu-FanWang)

Hello all,


Shu-Fan, Yaroslav is correct - you would need to use a selection buffer and applyyour macro to an entity ( view) stored in the buffer.


In WF4one of theways to get to a view (ProView), besides user interactive selection, is to keep a map (STL container) of view names in a drawingby callingeither visit or collect functionaftersome ProNotify events.ProModelitemByNameInit works with those view names andinitiates ProModelitem which should be used in ProSelectionAlloc.


You could also try to use pre wildfire macro syntax '#..' by name or by ID option but I don't even know where to look for old books.


HIH.


Feliks.




In Reply to Shu-Fan Wang:



Hi~Yaroslav,


Thanks for your quick reply,


That is what we needed, but with some problem.


Due to some of our customers still using WF4, we are using WF4's APIs. (sorry, it's my fault, not checking higher versions...)


Those APIs are new introduced in Creo/Elements, is there any way to doing this in WF4? or ways to instead?



The worst case, we plan to use ProMacro() toreplace those APIs.


But facing another problem, we can't auto select drawing view after ProDrawingGeneralviewCreate() to let the ProMacro() start.


(ProMacro() start with right mouse button click to open menu)


Is there any way to auto select drawing view?



Thanks a lot


Shu-Fan


Hello all,


We still failed to auto select view by the Toolkit.


We found that trail file cando the selection, combine that with ProMacro(), we can setXsection to the drawing views.


It's not a good solution, but we can accept that (Only on WF4.0).



Thanks for all your kindly help~


Shu-Fan,




In Reply to Feliks Veysman:



Hello all,


Shu-Fan, Yaroslav is correct - you would need to use a selection buffer and applyyour macro to an entity ( view) stored in the buffer.


In WF4one of theways to get to a view (ProView), besides user interactive selection, is to keep a map (STL container) of view names in a drawingby callingeither visit or collect functionaftersome ProNotify events.ProModelitemByNameInit works with those view names andinitiates ProModelitem which should be used in ProSelectionAlloc.


You could also try to use pre wildfire macro syntax '#..' by name or by ID option but I don't even know where to look for old books.


HIH.


Feliks.


Hi,


I have wriiten a code that select existing datum plane by it's name


ProSelection selectDatumPlane(wchar_t* inName)
{
ProMdl model;
ProError status = ProMdlCurrentGet(&model);
ProModelitem item;
status = ProModelitemByNameInit(model,PRO_SURFACE,inName,&item);

ProSelection modelSelection = nullptr;
ProError err = ProSelectionAlloc(NULL,&item,&modelSelection);

if(err == PRO_TK_BAD_INPUTS)
return modelSelection;

return modelSelection;
}


you can refer this code.


Change as per your requirement for automatic selection of view.


Announcements


Top Tags