TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: danglar on August 15, 2016, 01:56:27 AM
-
Hi All!
I find this routine on this forum
http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/align-all-objects-along-one-x-y-z-axi...
and I think it's very useful, but I have a problem when I want to align attributed blocks along one X/Y/Z axis of a reference point.. attributes remains on previous place
Can you fix this problem?
Thank you anyway
-
The link isn't good...
Please recheck it...
-
Hi Marko!
How are You?
This is unbroken link (I mean)
http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/align-all-objects-along-one-x-y-z-axis-of-a-reference-point/m-p/5932176/highlight/false
-
Here try this, but make sure it's current WCS...
(defun c:AxAlign
( / ax co ss i ed pt e ptt
)
( (getkword "Which coordinate make the same [X/Y/Z] <Y>: ") )
("Y")
)
)
)
)
( (= ax "X")
)
( (= ax "Y")
)
( (= ax "Z")
)
)
pt
ed
)
)
)
( (= ax "X")
)
( (= ax "Y")
)
( (= ax "Z")
)
)
ptt
ed
)
)
)
)
)
)
)
)
-
Thank you for your quick replay Marko, but we still have a problem..
I send you 2 pictures "before" and "after" invoking this function and of couse dwg file with attributed blocks.
I supose it's can help you to descript the code
-
danglar, you need to rotate those blocks along with their attributes... Just use rotate command with "reference" option and for first reference choose angled vector and for destination use your Xaxis aligned line - or turn ortho F8 and pick destination point somewhere on positive Xaxis value (for start point of rotation use OSNAP "end", and for picking vector use OSNAP "nea" and for destination vector turn OSNAP off F3 and pick point on Xaxis positive value)...
-
Marko. In a first step I need to move those blocks without any rotation. Those blocks must have same Y coodinate..
Rotation - it's the second step. As you see from the pictures non attributed blocks receve same Y coordinate along horizontal line and I need the same thing for attributed blocks even they have initial rotation angle
-
Ok, Igal, I've updated posted code... Test it now...
M.R.
-
Now it's work like a charm!
Thank you Marko. Today you save me a lot of time for preparing lighting supply flowcharts.
I jast combined your modification with Henrique subroutine in order to make a needful rotation in a same time (see attached lisp)