Start a topic
With the exception of Windchill, The PTC Community is on read-only status until April 6 in preparation for moving our community to a new platform. Learn more here
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here

Translate the entire conversation x

ProXsecCompXhatchStyleSet&Hatch

ML_14468763
2-Explorer

ProXsecCompXhatchStyleSet&Hatch

I'm a student and I have a question. Could you please explain how to use the method "ProXsecCompXhatchStyleSet"? I want to change the pattern of the section lines in the perspective view, but I'm not sure how to use this API or how to use other related APIs. Can someone help me?

5 REPLIES 5

Hello @ML_14468763,

 

It looks like you have a response from a community expert. If it helped you solve your question please mark the reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

XC_MQ
5-Regular Member
(To:ML_14468763)

ProXsec p_xsec; 
ProError status;
ProColor warning_color;
ProXsecNewXhatchStyle p_xhatch_style{};
warning_color.method = PRO_COLOR_METHOD_TYPE;
warning_color.value.type = PRO_COLOR_WARNING;
 
status = ProXsecNewXhatchStyleCreateFromName(L"Wood", warning_color, PRO_XHATCH, &p_xhatch_style);
if (status != PRO_TK_NO_ERROR)
return;
 
ProXSectionItem* xsec_item_arr;
ProXsecMdlname p_xsecmdlname;
status = ProXsecMdlnameAlloc(xsecMdl, p_xsec.xsec_name, &p_xsecmdlname);
if (status != PRO_TK_NO_ERROR)
return;
status = ProXSectionItemsCollect(p_xsecmdlname, NULL, &xsec_item_arr);
if (status != PRO_TK_NO_ERROR)
return;
 
int n_xsec_items = 0;
status = ProArraySizeGet((ProArray)xsec_item_arr, &n_xsec_items);
 
for (int ii = 0; ii < n_xsec_items; ii++)
{
status = ProXSectionItemXhatchStyleSet(xsec_item_arr[ii], item.view, L"Wood", &p_xhatch_style);
}
status = ProXSectionItemsArrFree((ProXSectionItem**)&xsec_item_arr);
ProXsecRegenerate(&p_xsec);

@XC_MQ  Thank you so much, I was stuck into this finally got it right.

 

 

 

 

XC_MQ
5-Regular Member
(To:VP_14440689)

You're welcome! I happened to be looking into this as well. Glad you got it sorted!

Announcements
Top Tags