Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hello!
After the creation of a projection view I want to display the axis of the top assembly.
Does anyone know how it's work? I found no examples.
That's what I did, but it doesn't work:
err = ProDrawingProjectedviewCreate(m_Drawing, Views[ParentViewNo],
PRO_B_FALSE, Point, &NewView);
ProSolid DrwMdl;
err = ProDrawingCurrentsolidGet(m_Drawing, &DrwMdl);
ProModelitem Axis;
err = ProModelitemByNameInit(ProSolidToMdl(DrwMdl), PRO_AXIS, L"A_Z", &Axis);
cout << "Fill ID Table..." << endl;
ProIdTable IDTable;
for (int t = 0; t < PRO_MAX_ASSEM_LEVEL; t++)
IDTable[t] = -1;
ProAsmcomppath AsmPath;
err = ProAsmcomppathInit(DrwMdl, IDTable, 0, &AsmPath);
ProSelection Sel3D;
err = ProSelectionAlloc(&AsmPath, &Axis, &Sel3D);
err = ProSelectionViewSet(NewView, &Sel3D);
err = ProPntTrfEval(Point, DrwMatrix, Point);
ProVector Vec = {97.71043, 265.51527, 0.0}; // ???
err = ProVectorTrfEval(Vec, DrwMatrix, Vec);
ProSelection Sel2D;
err = ProDrawingAxisToDtlaxis(m_Drawing, Sel3D, Vec, &Sel2D);
Thanks! Lars
Hi all,
Lars,
Try this
I am writing under assumption that you are dealing with the part drawing and not with the assemblycomponent drawing.
-ProModelitemByNameGet( ...., &AXIS_FEATURE);
-get ProGeomitem of axis out of AXIS_FEATURE with ProFeatureGeomitemVisit - result would be ProGeomitem axis_gi
-initialize ProAsmcomppath with ProAsmcomppathInit(axis_parent_mdl, NULL,0, &cpath); nothing else needed
-get view transformation matrix with ProDrawingViewTransformGet,the third argumentwill be PRO_B_TRUE
-get location of axis_gi in the part coordinate space with ProGeomitemToAxis and ProAxisDataGet or simply with ProGeomitemDataGet and cast pointer.
-transform location of axis_gi to drawing coordinates with ProPointTrfEval( axis_part_location, view_matrix, axis_drawing_location);
-allocate ProSelection with ProSelectionAlloc(&cpath, &axis_gi, &axis_sel);
-add view to selection ProSelectionViewSet
-add location of axis_gi in the part coordinate system to the selection with ProSelectionPoint3dSet( axis_part_location, &axis_sel);
-show axis in a drawing view with ProDrawingAxisToDtlaxis( drw_mdl, axis_sel, axis_drawing_location, &dtlaxis_sel);
HIH.
FV.
Hello!
Many thanks for spending time to answer my mail!!!
ProModelitemByNameInit with Type PRO_FEATURE returns PRO_TK_E_NOT_FOUND
err = ProModelitemByNameInit(ProSolidToMdl(DrwMdl), PRO_FEATURE, L"P_Z", &AxisFeature);
With Type PRO_AXIS it works fine. But I also testet it with
err = ProSolidFeatVisit(DrwMdl, VisitFeature, NULL, &FeatList);
Same result as with the code before.
I think, it's a bug of ProToolkit?
TAN: 144177
ProDrawingAxisToDtlaxis() is returning PRO_TK_GENERAL_ERROR for all axes in certain views (normally all but one view in a drawing).
After using Show and Erase for the view, ProDrawingAxisToDtlaxis() correctly returns the corresponding detail axis.
After using Show/Erase i don't get an error on ProDrawingAxisToDtlaxis.
I can use ProSelectionHighlight to highlight the returned selection.But this is not permanent. After a redraw, the axis is gone.
Does anyone have an idea?
Greetings, Lars