3D rotiranje teksta

Print

Rotiranje teksta u 3d okruzenju oko pojedinacnih tacaka insertovanja.

;3D rotate texts mtexts and blocks around an axis aligned

;on the x axis, passing by their individual insertion points.

3rt.lsp

 

kopirajte sledeci kod u notepad pa sacuvajte dokument sa ekstenzijom .lsp

 

 

(defun c:3rtx ( / *error* obj tmppoint)

;3D rotate texts mtexts and blocks aound an axis aligned

;on the x axis, passing by their individual insertion points. 

;made by Jef! 2015-12-11.

   (defun *error* ( msg )

        (if (not (member msg '("Function cancelled" "quit / exit abort")))

            (princ (strcat "\nError: " msg))

        )

        (princ)

   )

   (princ "\nSelect objects to rotate")

   (if (ssget)

        (progn

            (vlax-for obj (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))

               (if (or (eq (vla-get-objectname obj) "AcDbMText")

                       (eq (vla-get-objectname obj) "AcDbText")

                       (eq (vla-get-objectname obj) "AcDbBlockReference")

                   )

                   (progn

                      (vla-Rotate3D obj (vlax-3d-point (setq tmppoint (vlax-get obj 'InsertionPoint))) (vlax-3d-point (mapcar '+ tmppoint '(1 0 0))) (/ pi 2))

                      (if (and (eq (vla-get-objectname obj) "AcDbBlockReference")

                               (= (vlax-get-property obj 'HasAttributes) :vlax-true)

                          )

                          (vl-cmdf "_.AttSync" "Name" (vla-get-name obj))

                      )

                   )

                )

             )

         )

      (princ "nothing selected")

     )

   (princ)

)

Tags: