Hello,
I need to draw some geometry in my custom tool. I would like to place it on a plane determined by AccuDraw. How I can get this plane?
All the best
Wojciech
Wojciech said:I need to draw some geometry in my custom tool. I would like to place it on a plane determined by AccuDraw
I don't have V8i available, but CONNECT help tells me that the Accudraw class has members Accudraw.GetRotation, Accudraw.GetOrigin and Accudraw.GetCompassViewport.
Accudraw
Accudraw.GetRotation
Accudraw.GetOrigin
Accudraw.GetCompassViewport
Accudraw.GetCompassViewport returns an IndexedViewportP .
IndexedViewportP
Regards, Jon Summers LA Solutions
Thank you Jon,
I don't see Accudraw class in V8. There is mdlState_setAccudrawContext function but nothing to get AccudrawContext
Regards
Hi Wojciech,
Wojciech said:I don't see Accudraw class in V8.
Yes, it looks like this class does not exist in V8 C++ API.
Wojciech said:There is mdlState_setAccudrawContext function but nothing to get AccudrawContext
Unfortunately, there is no "get" variant of the mentioned function.
Wojciech said:How I can get this plane?
I am not sure it is possible in V8i. I was not able to find too many functions, related to AccuDraw, both in C and C++ V8i APIs documentation. Interesting is that some extra (possibly valuable) mdlAccuDraw_get functions are published in ustation.dll, but no header files are available for them.
The problem is that V8i API was designed more than 20 years ago, and the last real update (adding some C++ classes) happened, I guess, 15 years ago in V8i SS3.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thank you Jan,
I'm wondering if there is possible to make a workaround for this problem. For example whenever I click with my tool, there could be generated two other clicks. Then method MstnButtonEvent::GetPoint() gives me coordinates after AccuDraw locking mechanism. So I could construct the resulting plane.
Is there a way to generate a MstnButtonEvent for given view coordinates?
Best regards
Your tool should call mdlRMatrix_fromView and pass true for "allowConstruction".
=---------------------------------------------------------------*//*** @Description Returns (copy of) the rotation matrix for a view or for the* current aux coordinate system.* Columns 0, 1, and 2 contain coordinates of the X, Y, Z global axes* as seen in the view. Rows 0, 1, and 2 contain* coordinates of the view X, Y, Z axes as seen from* the global system.* @param[out] rotMatrixP * @param[in] view view number* @param[in] allowConstruction if true, use aux coords* @ingroup mdlRMatrix* @bsimethod* @RequiredLibrary nativewindow.lib+--------------+--------------+---------------+----------------+-------------*/MSCORE_EXPORT void mdlRMatrix_fromView(RotMatrixP rotMatrixP,int view,bool allowConstruction);
The priority is: AccuDraw if active > ACS if acs plane lock enabled > view orientation
HTH
-B