More settings fun

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-07-01
10:26 PM
- last edited on
‎2023-08-07
11:59 AM
by
Doreena Deng
‎2005-07-01
10:26 PM
I am trying to get our Section Tool to default to a few things, like "Use element colors" and "Show on stories partially in range."
The story part works, the Use Element Colors does not, and I am getting the "No error encountered" response in the Report window, so I know the right loop is running, but nothing seems to be happening. This same structure is working for almost every other tool in the toolbox....
Yes, I know the reporting code is ugly, but I usually just copy/paste it in as needed to help me chase problems....
The story part works, the Use Element Colors does not, and I am getting the "No error encountered" response in the Report window, so I know the right loop is running, but nothing seems to be happening. This same structure is working for almost every other tool in the toolbox....
Yes, I know the reporting code is ugly, but I usually just copy/paste it in as needed to help me chase problems....
void KA_SetSection() { API_Element element, mask; GSErrCode err; BNZeroMemory (&element, sizeof (API_Element)); element.header.typeID = API_CutPlaneID; err = ACAPI_Element_GetDefaults (&element, 0); if (err == NoError) { ACAPI_ELEMENT_MASK_CLEAR (mask); ACAPI_ELEMENT_MASK_SET (mask, API_CutPlaneType, markerSize); ACAPI_ELEMENT_MASK_SET (mask, API_CutPlaneType, textSize); ACAPI_ELEMENT_MASK_SET (mask, API_CutPlaneType, useElemPens); ACAPI_ELEMENT_MASK_SET (mask, API_CutPlaneType, cutPlShow); element.cutPlane.markerSize = 10.578278; // 30 points, in mm element.cutPlane.textSize = 2.644569; // 7.50 points, in mm element.cutPlane.useElemPens = true; element.cutPlane.cutPlShow = APICutPl_ShowPartRange; ACAPI_Element_ChangeDefaults (&element, NULL, &mask); char elemStr[32]; char msgStr[256]; CHCopyC ("No Error", elemStr); sprintf (msgStr, "%s Encountered", elemStr); ACAPI_WriteReport (msgStr, false); } else { char elemStr[32]; char msgStr[256]; CHCopyC ("Error", elemStr); sprintf (msgStr, "%s Encountered", elemStr); ACAPI_WriteReport (msgStr, false); } return; }Any suggestions would be greatly appreciated.
Tom Waltz
Labels:
- Labels:
-
Add-On (C++)
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-07-02 08:29 AM
‎2005-07-02
08:29 AM
I think the useElemPens field is for "Use Cut Element's Own Pencolors" in the Cut Elements rolldown panel. I didn try it on AC9, but it seem works on AC81.
If you mean "Use Symbol Colors" checkbox in the Marker rolldown panel, I think you need use GetDefaultEx and ChangeDefaultEx. I guess it is a marker field ( like useObjPens of ObjectType ), so you will need set the elementMarker and maskMarker parameters of the ChangeDefaultEx function.
But I didnt try it, just guessing.
If you mean "Use Symbol Colors" checkbox in the Marker rolldown panel, I think you need use GetDefaultEx and ChangeDefaultEx. I guess it is a marker field ( like useObjPens of ObjectType ), so you will need set the elementMarker and maskMarker parameters of the ChangeDefaultEx function.
But I didnt try it, just guessing.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-07-02 01:58 PM
‎2005-07-02
01:58 PM
Thanks, Oleg, I'll give that a shot!
Tom Waltz

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-07-06 04:40 PM
‎2005-07-06
04:40 PM
In playing with this a bit, it seems as though the API_CutPlaneType structure definition does not include any of the settings in the "Marker" pane of the Section Tool Settings menu, including which marker object to use, font size, and pen color.
I've been messing around with the GetDefaultEx functions, but they only seem to apply to a selected element, not setting the defaults of a selected tool (unless I misread that).
I've been messing around with the GetDefaultEx functions, but they only seem to apply to a selected element, not setting the defaults of a selected tool (unless I misread that).
Tom Waltz