Emk, I don't have my comp. at the moment and I am typing this from my phone... I am away from where I live and cant answer you until I came back home... Hope youll find solution and without my help... Sorry, but I cant analyze your request the way I would like to... Have a nice day and my regards to you and all swampers... M.R.
Here is a solution using the TransformBy method.
The function c:test uses InverseMatrix by Gile.
The final result will vary depending on the selected face but also on the point that was picked in the selection process.
Dear Emk,
Select the command Align
1) Select all objects
2) Specify first source point: S1
3) Specify first destination point: 0.0
4) Specify second source point: S2
5) Specify second destination point: 0,0,1
6) Specify third source point S3
7) Specify third destination point: 0.1
Regards
My code works fine on BricsCAD.
Maybe it will work on AutoCAD if you change:Code - Auto/Visual Lisp: [Select]To:
(setq mat ) )Code - Auto/Visual Lisp: [Select]
(setq mat (InverseMatrix ) ) ) )
Many thanks ,roy .
It's so Beautiful! This is " Select face for top " , how change to " select face for front " ?
Dear Emk,
Turn the running object snap settings for Endpoint on,
or type the abbreviation END!
Then you can snap the Endpoints S1,S2 and S3!
Command: ALIGN
Select objects: ALL
4 found
Select objects: ‘Enter’
Specify first source point: END of ‘pick S1’
Specify first destination point: 0,0,0
Specify second source point: END of ‘pick S2’
Specify second destination point: 0,0,1
Specify third source point or <continue>: END of ‘pick S3’
Specify third destination point: 0,1
Explanation:
The selected objects move from the source point S1 to the destination point 0,0,0.
The selected object is rotated (S1 and S2) so that it aligns with the destination object (0,0,0 and 0,0,1).
The selected object is then rotated again (S2 and S3) so that it aligns with the destination object (0,0,1 and 0,1).
http://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-Core/files/GUID-D0FA10D5-76EE-4B80-A285-43C7F39916DB-htm.html (http://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-Core/files/GUID-D0FA10D5-76EE-4B80-A285-43C7F39916DB-htm.html)
Regards
Many thanks ,roy .
It's so Beautiful! This is " Select face for top " , how change to " select face for front " ?
Try changing:Code - Auto/Visual Lisp: [Select]
to:Code - Auto/Visual Lisp: [Select]
Many thanks , Lee, It's very nice !
Thanks for jumping in Lee.
BTW: Strange limitation for (vlax-invoke) on AutoCAD.
Thanks for jumping in Lee.
BTW: Strange limitation for (vlax-invoke) on AutoCAD.
The final result will vary depending on the selected face but also on the point that was picked in the selection process.
Andy, you should experiment with the point you use to select the face.The final result will vary depending on the selected face but also on the point that was picked in the selection process.
Andy, you should experiment with the point you use to select the face.The final result will vary depending on the selected face but also on the point that was picked in the selection process.
(if
(setq ent (xd::ssget "\n>>>Choose 3D SOLID <Exit>:" '(":L" ((0 . "3DSOLID")))))
(progn
(while (not(setq ss1 (osnap (getpoint "\n>>>1.Pick a basic point: ") "endp" ))))
(while (not(setq ss2 (osnap (getpoint "\n>>>2.Pick a point on X axis: ") "endp" ))))
(while (not(setq ss3 (osnap (getpoint "\n>>>3.Pick a point on Z axis: ") "endp" ))))
(command "_.align" ent ""
"_non" ss1 "_non" "0,0"
"_non" ss2 "_non" "1,0,0"
"_non" ss3 "_non" "0,0,1"
)
(command "_.view" "_front" )
);end_progn
);end_if
Sometimes I use Roy's code Still have a small problem.
I use @HofCAD 's method.?
Sometimes I use Roy's code Still have a small problem.I use @HofCAD 's method.?
But if you use the _Align command why not align along the X and Y-axis, instead of the X and Z-axis?