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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

show model axis in drawing using vb api or pro toolkit

jay_baldania
5-Regular Member

show model axis in drawing using vb api or pro toolkit

Hi,

Has anyone managed to show 3D model axes in drawing using Creo VB API or ProToolkit?

Graphically like we do in "Show Annotation".

Regards,

Jaykishan

8 REPLIES 8
jay_baldania
5-Regular Member
(To:YaroslavSin)

And what about similar thing in VB API ?

I think, if axis, dims and etc are instance of ModelItem objects. So you can downcast to the Note interface to use the methods:

IpfcNote.Display() forces the display of the model note.
IpfcNote.Delete() deletes a model note.

jay_baldania
5-Regular Member
(To:YaroslavSin)

IN REPLY TO "YSINITSYN"

 

If we use model item owner of drawing, then that owner will only contain things with drawing.

When we have not yet annotated model dimensions, they won't appear in model item owner of drawing. Drawing item owner only contains all the things in drawing model tree.

@jay_baldania

Looks like from VB it is possible only show temporary erased notes (ModelItem).

If so, then @RolandRaytchev was right, that is not possible from VB.

jay_baldania
5-Regular Member
(To:YaroslavSin)

If we use model item owner of drawing, then that owner will only contain things with drawing.

When we have not yet annotated model dimensions, they won't appear in model item owner of drawing. Drawing item owner only contains all the things in drawing model tree.....

So the show is an axis in the drawing , so far I know is possible only in ProToolkit. As mention in the previous post it should be some code like this (if you have a selection of Axis feature - means ProSelect ("feature"....) otherwise you can create a selection -- if you have the id first ProFeatureInit to initialize the axis feature  and then with ProSelectionAlloc the create the selection of the axis feature) You need also the view where you want to show the axis:

ProError TestShowAxis(ProDrawing drw , ProView view , ProSelection *sel_axis)
{
ProError err;
err= ProSelectionViewSet(lView , sel_axis);  
if (err != PRO_TK_NO_ERROR) return err;
err= ProAnnotationByFeatureShow(drw ,sel_axis , NULL , PRO_AXIS);
//here some regeneration to be sure that it will be displayed properly
if (err != PRO_TK_NO_ERROR) return err;
err= ProDrawingViewRegenerate(drw view);
if (err != PRO_TK_NO_ERROR) return err;
err=  ProDwgSheetRegenerate(drw, 1);
if (err != PRO_TK_NO_ERROR) return err;
err=  ProDwgDraftRegenerate(drw); 
if (err != PRO_TK_NO_ERROR) return err;
return PRO_TK_NO_ERROR;
}

There is PTC article (

https://www.ptc.com/en/support/article?n=CS262812) but I think not public which states:

Is it possible to show bend line axes in drawings using VB APIs in Creo Parametric?

Applies To

  • Creo Parametric 1.0 to 4.0

Description

  • Is it possible to show bend line axes in drawings using VB APIs ?

Resolution

  • There is no VB API support available to do this.
  • VB API is a free customization module and only basic functionalities are offered
  • User may consider using powerful TOOLKIT customization, which provides most numbers APIs for Creo Parametric.

========

 

So according this statement is not possible in VB - I think also in Creo 5.0  there is no new functionality but , did not check it more detailed.

A workaround forVB could be to define in Toolkit (requires ProToolkit lisense to develop and unlock it)  Task Based library (how to define a Task Based library , please, see the chapter Task Based Application Libraries in the Toolkit User Guide) One time defined such libraries could be called from Visual Basic API , Web.Link and J-Link (how to use Task Based library in VBA , please, see the chapter   Task Based Application Libraries in the VB API User's guide)

Ok. I think I will have to finally learn to develop things in protoolkit.

Top Tags