Skip to main content
15-Moonstone
October 31, 2016
Solved

ProDimensionCanRegen in Creo3

  • October 31, 2016
  • 1 reply
  • 4247 views

Cannot get the function to return anything but -8.   There is an SPR 4887879 on this but I still get the same bad results after updating from Creo3 m30 to m100, then again to m110.

Called during visit action, I am using several other proDimension functions with good results, so I'm confident my arguments are legit. 

ProDimension **dims = (ProDimension**)data;

ProBoolean CanRegen;

status = ProDimensionCanRegen((ProDimension*)dimension, &CanRegen);

So my questions:

1.  Has anyone got this function to Work in Creo 3?

2. When there is an spr related to code, I imagine you should recompile after your upgrade? Did that.

3.  When you upgrade creo 3, does it actually go in and replace the toolkit API source files?  I did check the toolkit box.  Or do you feel the need to just wipe out the old version and install clean? 


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.
Best answer by mender

Presuming you want to skip the feature dims, and that you'd want to skip driven dimensionsmade in an entirely different drawing which cannot be shown in your target drawing, you can skip that and just use ProDimensionCanRegenerate(p_dim, p_draw, &can_regen) 's return value (both will give PRO_TK_BAD_CONTEXT).

To the license issue... though it seems strange for a dimension in 2d to be requiring this, I don't think I can address whether a license requirement for a Toolkit API that replaced a Pro/DEVELOP API is justified in a forum discussion.  Please file an SPR, saying that you could do this with the Pro/DEVELOP function and basic TK license, and you hope/expect to be able to do the same action in the new release without an additional license, and I'll refer it to the right person.

1 reply

FV_01
November 1, 2016

Matt,

The function ProDimensionCanRegen is obsolete.

You should be using ProDimensionCanRegenerate((ProDimension*)dimension, NULL, &CanRegen);

HIH.

Feliks.

12-Amethyst
November 1, 2016

Some clarification on that:  ProDimensionCanRegenerate was introduced in Creo 3 M080 to cover the case of a driven dimension which lives in a solid model, but the query is being made in the context of a drawing.  ProDimensionCanRegen(dim, &can_regen) is equivalent to ProDimensionCanRegenerate(dim, NULL, &can_regen).  This probably is relevant to your situation, if you are passing a driven dimension made from drawing mode and owned by a solid, which can only be displayed in the context of this drawing, as PRO_TK_BAD_CONTEXT includes the case where the dimension cannot be displayed in the context.  With ProDimensionCanRegen, the context is the owning solid.

Short form, as FV said, except use the drawing instead of NULL.

If this isn't relevant (you aren't trying to ask about a dimension owned by a solid, but in the context of a drawing), some additional details could be useful.

msteffke15-MoonstoneAuthor
15-Moonstone
November 1, 2016

Well what you are saying is definitely barking up the right tree.  This is indeed a drawing dimension, whose owner is the solid, not the drawing.   Maybe my problem is the dimensions I'm testing are not driven.    What determines if a dimension is driven?

The dimemsion I'm testing is the length of a feature, lets say a cut.   If there is a parameter that turns this cut off,  The dimension becomes magenta in the drawing.  It that dimension considered driven?