liuhaixin88 发表于 2022-7-5 20:19:45

hello!someone can help me?
 
I want rotate 3DSolid like this ,not a block, can do?

ymg3 发表于 2022-7-5 20:22:34

liuhaixin,
 
You can rotate solid. Only problem is getting your base point for rotation.
As you know entity list is kind of encrypted.
 
You could get the min of the bounding box and rotate around this point.
 

(defun c:3dsr ( / ** ang axs bpt ent obj )   (while       (progn (setvar 'errno 0) (setq ent (car (entsel "\nSelect Solid to rotate: ")))         (cond               ((= 7 (getvar 'errno)) (princ "\nMissed, try again."))               ((/= 'ename (type ent)) nil)               ((/= "3DSOLID" (cdr (assoc 0 (entget ent)))) (princ "\nPlease select a Solid."))               ((setq obj (vlax-ename->vla-object ent)                      **(vla-getboundingbox obj 'mini 'maxi)                      bpt (vlax-safearray->list mini)                                             ang (/ pi 2.0)                   )                   (princ "\nRotate about : ");;;;; Rest of the code is same;;;;;;;;;
 
ymg

liuhaixin88 发表于 2022-7-5 20:25:58

Oh! is cool.Thanks ymg.
but I find Y-axis and Z-axis exchange. press"Y" is rotation around the "Z" axis. press"Z" is rotation around the "Y" axis.

ymg3 发表于 2022-7-5 20:29:34

liuhaixin,
 
I believe you are mistaken.
 
Lee's order for the rotation is correct.
 
ymg

liuhaixin88 发表于 2022-7-5 20:31:59

 
 
ymg,
I'm sorry!I was wrong!
I created a new document, test, It's OK!

Lee Mac 发表于 2022-7-5 20:35:44

Thank you for stepping in ymg, good explanation.

Least 发表于 2022-7-5 20:37:40

Lee
 
Is it a simple modification for the block rotate routine to work with multiple blocks at a time?How would I go about changing it?
Thanks
Pads

aygn 发表于 2022-7-5 20:40:35

Hi everybody,
 
I need to use ROTATE3D on texts. I have over 2000 texts on TOP view and I want to rotate them so that I can read them on LEFT view.
I need a lisp to Rotate3D multiple texts around their own base point, -90 degrees on Y Axis.
 
I would really appreciate any help.

Lee Mac 发表于 2022-7-5 20:43:56

 
Try the following modification of my earlier code:

(defun c:3drtxt ( / ang axs idx lst obj sel )   (setq ang (/ pi 2.0))   (if (setq sel (ssget "_:L" '((0 . "TEXT,MTEXT"))))       (progn         (repeat (setq idx (sslength sel))               (setq lst                   (cons                     (cons (setq obj (vlax-ename->vla-object (ssname sel (setq idx (1- idx)))))                           (vlax-get obj                               (if (or (="AcDbMText"   (vla-get-objectname obj))                                       (= acalignmentleft (vla-get-alignment obj))                                 )                                 'insertionpoint                                 'textalignmentpoint                               )                           )                     )                     lst                   )               )         )         (princ "\nRotate about : ")         (while               (setq axs                   (cdr                     (assoc (grread nil 10)                        '(                               ((2 120) 1.0 0.0 0.0)                               ((2 088) 1.0 0.0 0.0)                               ((2 121) 0.0 1.0 0.0)                               ((2 089) 0.0 1.0 0.0)                               ((2 122) 0.0 0.0 1.0)                               ((2 090) 0.0 0.0 1.0)                           )                     )                   )               )               (foreach itm lst                   (vlax-invoke (car itm) 'rotate3d (cdr itm) (mapcar '+ (cdr itm) axs) ang)               )         )       )   )   (princ))(vl-load-com) (princ)

mikekmx 发表于 2022-7-5 20:47:13

 
+1!
 
Thank you Lee.... i never knew i needed this but it is very nice
 
AutoDesk should hire some people like you.
页: 1 [2]
查看完整版本: rotate3d Lisp, Need help