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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

set Tolerance from Solid (TK)

Eike_Hauptmann
13-Aquamarine

set Tolerance from Solid (TK)

Hi @ all


I use a Toolkit DLL from JLink. I want to set the Tolerance Options. I think I can do it with ProSolidModelClassSet but have too Problems.


First is that I don't know if its the right command, because I haven't a option to set "ANSI". I think PROMODELCLASS_NONE can be ANSI but don't know it for sure.


Second is that always I set another ModelClass everything seems to be fine. If I click into (WF4) Setup - Tolerances - ModelClass, Pro/Engineer killed themself.



Everyone has a Idea how I can set the Tolerance Modes (DIN/ISO - ANSI) and ModelClass correctly ?


Thanks,


Eike


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.
2 REPLIES 2

Eike,
First of all thanks very much for your participation on this exploder. As
a new member to the community and TC I am pleased to see your involvement.
Secondly, I apologize for the delay in responding to your inquiry. I
thought it was a very interesting question but I didn't have time to
research it until now. That being said I have no programmatical
experience with this particular topic however I think I might be able to
point you in the right direction. So, here goes...

First, the ProSolidModelClassSet API doesn't seem to have any bearing on
the standard being used for the dimension. It only sets the ISO/DIN model
class (whatever that means) to the following values:

PROMODELCLASS_NONE
PROMODELCLASS_FINE
PROMODELCLASS_MEDIUM
PROMODELCLASS_COARSE
PROMODELCLASS_VERY_COARSE


The only place in the Pro/TOOLKIT documentation that I found concerning
the ANSI standard and dimensions is with Ordinate Dimensions. Read the
API Wizard under User's Guide->Annotation: Annotation Features and
Annotations->Dimensions->Accessing Ordinate and Baseline Dimensions and
you will find the API ProDimensionOrdinatestandardSet/Get(). However you
will need the Pro/TOOLKIT for 3D Drawings to execute these APIs.

PATRICK S WILLIAMS
Information Technology
Mechanical Engr Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (office)
+1 520.446.0244 (pager)
+1 520.545.6399 (fax)
-

6221 S Palo Verde Rd
Tucson, AZ 85706-5093 USA
www.raytheon.com

Follow Raytheon On




This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.


I know it's years later : )



But here are my solution for thread completness.




ProError setToleranceTypeF(ProName mdlName, ProName mdlType, ProName tolType, ProArgument** outputs)
{
ProError ret = PRO_TK_NO_ERROR;
ProMdl mdl = NULL;
ProWstring *w_array;
ProValueData data;
data.type = PRO_VALUE_TYPE_WSTRING;

// read the model
if (wcslen(mdlName) > 0) {
ProMdlType type = GetMdlType(mdlType);
ret = ProMdlInit(mdlName, type, &mdl);
if (ret != PRO_TK_NO_ERROR)
return PRO_TK_CONTINUE;
}

if (mdl == NULL)
return PRO_TK_LINE_TOO_LONG;

// save the status
ProModelClass pmc;
if (wcscmp(tolType,L"ANSI") == 0) {
ret = ProMacroLoad(L"~ Command `ProCmdMmSetup` ;#TOL SETUP;#STANDARD;#ANSI;Ja; #DONE/RETURN;#DONE");
ret = ProMacroExecute();
ret = ProMacroLoad(L"~ Command `ProCmdMmModelProperties` ; ~ Activate `mdlprops_dlg` `TOLERANCE_lay_Controls.push_Change.lay_instance`; #STANDARD;#ANSI;Ja; #DONE/RETURN;~ Activate `mdlprops_dlg` `DlgClose_push`;");
ret = ProMacroExecute();
} else {
ret = ProMacroLoad(L"~ Command `ProCmdMmSetup` ;#TOL SETUP;#STANDARD;#ISO/DIN;Ja; #DONE/RETURN;#DONE");
ret = ProMacroExecute();
ret = ProMacroLoad(L"~ Command `ProCmdMmModelProperties` ; ~ Activate `mdlprops_dlg` `TOLERANCE_lay_Controls.push_Change.lay_instance`; #STANDARD;#ISO/DIN;Ja; #DONE/RETURN;~ Activate `mdlprops_dlg` `DlgClose_push`;");
ret = ProMacroExecute();
if (wcscmp(tolType,L"FINE") == 0) {
pmc = PROMODELCLASS_FINE;
} else if (wcscmp(tolType,L"MEDIUM") == 0) {
pmc = PROMODELCLASS_MEDIUM;
} else if (wcscmp(tolType,L"COARSE") == 0) {
pmc = PROMODELCLASS_COARSE;
} else if (wcscmp(tolType,L"VERY_COARSE") == 0) {
pmc = PROMODELCLASS_VERY_COARSE;
}
ret = ProSolidModelclassSet((ProSolid)mdl, pmc);
}
if (ret != PRO_TK_NO_ERROR && ret != PRO_TK_BAD_CONTEXT)
return ret;
return ret;
}

Best regards,
Eike
Top Tags