![]() ![]() 5 ) ) ) ( setq ang ( ang pi ) ) ) ( setq hght ( getreal "\nText Height : " ) ) ( setq mspace ( vla-get-modelspace ( vla-get-activedocument ( vlax-get-acad-object ) ) ) ) ( setq mtextobj ( vla-addMText mspace ( vlax-3d-point entpt ) 0. ![]() ![]() ( vl-load-com ) ( setq es ( entsel ) entpt ( osnap ( cadr es ) "_nea" ) ang ( angle ' ( 0 0 0 ) ( vlax-curve-getFirstDeriv ( vlax-ename- > vla-object ( car es ) ) ( vlax-curve-getParamAtPoint ( vlax-ename- > vla-object ( car es ) ) entpt ) ) ) ) ( if ( and ( > ang (/ pi 2 ) ) ( < = ang ( * pi 1. The key to finding the rotation is to determine the first derivative (slope) of the curve at the point the entity was selected. Since this requirement of aligning an MText along a curve is quite essential in Civil / Survey applications, I am posting a bare-bone implementation of it that you can customize. Kent Cooper's nice reply in that forum post provides all that is necessary to implement that. In this discussion forum post, the developer wanted an MText to align automatically with the curve without having to provide additional inputs for specifying the rotation.
0 Comments
Leave a Reply. |