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
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
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.
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.
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.
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
Description
Resolution
========
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.