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

Creo Pro/TOOLKIT – Axis-Based Dimension Attachments Not Returned (Any API or Workaround?)

AS_13847166
10-Marble

Creo Pro/TOOLKIT – Axis-Based Dimension Attachments Not Returned (Any API or Workaround?)

I am using Creo Pro/TOOLKIT (C++) to extract drawing dimension attachments.

Observed behavior:

  • When a dimension is attached to an edge or surface, all attachment APIs return valid results.
  • When a dimension is attached to a cylindrical axis / hole centerline, none of the following APIs return that attachment:
    • ProDimensionAttachmentsGet
    • ProDrawingDimAttachpointsGet
    • ProDrawingDimAttachpointsViewGet

This occurs for both linear and ordinate dimensions, even though the drawing visually shows the dimension referencing the cylinder axis.

Questions:

  1. Is this behavior by design in Creo (i.e., axis stored as an implicit or drawing-only entity)?
  2. Is there any direct API to retrieve axis-based dimension attachments?
  3. If not, what are the recommended workarounds or best practices to catch attachments for dimensions with axis as attachments?

Any guidance or confirmation would be appreciated.

9 REPLIES 9

ProDimensionAttachmentsGet require a license key for „TOOLKIT for 3D Drawings“, you have that lic key?

AS_13847166
10-Marble
(To:RPN)

Thanks for Replying @RPN , We have a license key for ProDimensionAttachmentGet
and to add on: if a dimension is having two attachment (one as an edge) and the other one is the cylinder or hole axis,
The ProDimensionAttachmentGet API is retrieving the edge but failing to get the hole axis.

Sorry, as far I know you can’t have a license for a single call, for ProDimensionAttachmentGet a Toolkit license is not enough! On compilation you will not see an error, -4 = NOT_FOUND may tell you that the key is not found. It may return valid data until you not call 3D Drawing related data.

AS_13847166
10-Marble
(To:RPN)

I am having the license named "TOOLKIT-for-3D_Drawings"

Is that enough or do i need more?

 

No that is good, if this (both) is active during you run (debug your code) Creo. 

 

NOT_FOUND - Hmm,

are you sure you have setup the dimension correct, It must be a PRO_DIMENSION or a PRO_REF_DIMENSION point to the Solid with a correct ID. Check the item with ProModelitemInit, and the correct type, you need to get PRO_TK_NO_ERROR.

 

Or is the returned attachments_arr empty? What is the Array size?

 

What are the returned status values?

 

The attachments structure is an array of two ProSelection entities, from this you need to get the modelitem. You follow this?

 

 

 

AS_13847166
10-Marble
(To:RPN)

Yeah i have checked with the other side attachment type correctly and properly getting ProModelItem handle under the 
ProSelectionModelitemGet API.

So your returned size is 2, but if  you have a dimension from one centerline to another you don't get the axis geom iD?

 

What is the modelitem content, type, ID?

 

From the manual: Note
The attachments structure is an array of two ProSelection entities. It
is provided to support options such as intersect where two entities must be
passed as input. From Creo Parametric 3.0 onward, you can create
dimensions that have intersection type of reference. The intersection type
of reference is a reference that is derived from the intersection of two
entities.

The function ProDimensionAttachmentsGet() and
ProDimensionAttachmentSet() provide access to the geometric
references and parameters of the driven or reference dimension. These functions
support dimensions that are created with intersection type of reference.

 

The last sentence I don't understand, and maybe the already known information makes this call absolut, for example if you have a diameter.

 

Are you dealing with drawings created in the same version, or something which is very old?

 

There is also ProDrawingDimAttachsGet()/ProDrawingDimAttachpointsGet() maybe you get here what you are searching for?

 

Purpose: Retrieves the attachments and the sense of the specified
drawing dimension. Only applicable for dimensions created
in drawing mode.
This function also supports drawing dimensions created
from intersections of geometric entities.

AS_13847166
10-Marble
(To:RPN)

We have tried all the three available APIs but not getting needed output

So, you don’t get the geom axis? So what are you expecting?

 

can you share some „C“ code, maybe one function from your program, I know it’s frustrating if you search the needle. You can also write here a mail. 
Else I’m out, because it is to complicated with that amount of information. 

Announcements



Top Tags