Author Topic: New UCS on 3DSolid Face  (Read 1536 times)

0 Members and 1 Guest are viewing this topic.

LogicTools

  • Newt
  • Posts: 36
New UCS on 3DSolid Face
« on: May 22, 2020, 12:12:23 PM »
I would like to replicate UCS command Face option.
command: "UCS" then option: "Face" then "accept"
The new UCS is created and the icon stays on the point selected on the face.
(vl-cmdf "._UCS" "_F" pause "") allows to enter the point but no new UCS or icon are created, not even with <ctrl> down when the face is selected.
Is there a way to programmatically create a new UCS on a 3DSolid face?
Thank you.




LogicTools

  • Newt
  • Posts: 36
Re: New UCS on 3DSolid Face
« Reply #1 on: May 22, 2020, 12:26:07 PM »
I found the way guys!!!
Just (vl-cmdf "._UCS" pause "") then select the face.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: New UCS on 3DSolid Face
« Reply #2 on: May 22, 2020, 09:26:49 PM »
Maybe these can be of use to you, I saw this post and it reminded me of the simple routines I have been using (since 2008 apparently!), cheers.

Code - Auto/Visual Lisp: [Select]
  1. ;;; Mick's 3d lisp routines - Sept. 2008.;;;;;;;;;;;;;;;;;;;;;;;;;
  2.  
  3. ; uf - quickly align ucs with a 3d face that you select. MSD-2008
  4. (DEFUN C:uf ()
  5.   (command ".ucs" "f" pause)
  6.   (princ)
  7.   (princ)
  8. )
  9.  
  10. ; u3 - quickly align ucs with a 3 point pick. MSD-2008
  11. (DEFUN C:u3 ()
  12.   (command ".ucs" "3" pause)
  13.   (princ)
  14.   (princ)
  15. )
  16.  
  17. ; uS - save new ucs as 'name' MSD-2008
  18. (DEFUN C:us ()
  19.   (command "_ucs" "_s" pause)
  20.   (princ)
  21.   (princ)
  22. )
  23.  
  24. ; ux - rotate ucs about x axis by 90 deg. MSD-2008
  25. (DEFUN C:ux ()
  26.   (command "_ucs" "_x" "90")
  27.   (princ)
  28.   (princ)
  29. )
  30.  
  31. ; uy - rotate ucs about y axis by 90 deg. MSD-2008
  32. (DEFUN C:uy ()
  33.   (command "_ucs" "_y" "90")
  34.   (princ)
  35.   (princ)
  36. )
  37.  
  38. ; uz - rotate ucs about z axis by 90 deg. MSD-2008
  39. (DEFUN C:uz ()
  40.   (command "_ucs" "_z" "90")
  41.   (princ)
  42.   (princ)
  43. )
  44.  
  45. ; up - set ucs to previous ucs. MSD-2008
  46. (DEFUN C:up ()
  47.   (command "_ucs" "_p")
  48.   (princ)
  49.   (princ)
  50. )
  51.  
  52. ; uv - set ucs to current view. MSD-2008
  53. (DEFUN C:uv ()
  54.   (command "_ucs" "_v")
  55.   (princ)
  56.   (princ)
  57. )
  58.  
  59. ; uo - set ucs to new origin. MSD-2008
  60. (DEFUN C:uo ()
  61.   (command "_ucs" "_o" pause)
  62.   (princ)
  63.   (princ)
  64. )
  65.  
  66. ; fm - face move, moves a 3d face such as a hole in a 3d solid; MSD-2008
  67. (DEFUN C:fm ()
  68.   (command "_solidedit" "_face" "_move" pause)
  69.   (princ)
  70.   (princ)
  71. )
  72.  
  73.  
  74. ; fd - face delete, deletes a 3d face such as a hole in a 3d solid; MSD-2008
  75. (DEFUN C:fd ()
  76.   (command "_solidedit" "_face" "_delete" pause)
  77.   (princ)
  78.   (princ)
  79. )
  80.  
  81. ; fe - face extrude, extrudes a 3d face to lengthen a 3d solid say; MSD-2008
  82. (DEFUN C:fe ()
  83.   (command "_solidedit" "_face" "_extrude" pause)
  84.   (princ)
  85.   (princ)
  86. )
  87.  
  88. ; fr - face rotate, rotates a 3d face/s such as a hole group in a 3d solid; MSD-2008
  89. (DEFUN C:fr ()
  90.   (command "_solidedit" "_face" "_rotate" pause)
  91.   (princ)
  92.   (princ)
  93. )
  94.  
  95.  
  96. ; ub - quickly align ucs with an object that you select. MSD-2008
  97. (DEFUN C:ub ()
  98.   (command ".ucs" "ob" pause)
  99.   (princ "\nUCS now aligned with your selection: ")
  100.   (princ)
  101. )
  102.  
  103.  
  104. ; ur - quickly rotate ucs 180 deg.  MSD-2008
  105. (DEFUN C:ur ()
  106.   (command ".ucs" "n" "z" "180")
  107.   (princ)
  108.   (princ)
  109. )
  110.  
  111. ; uw - quickly set the UCS to world UCS. MSD-2008
  112. (DEFUN C:uw ()
  113.   (command ".ucs" "")
  114.   (princ "\nUCS now aligned with the world UCS: ")
  115.   (princ)
  116. )
  117.  
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

LogicTools

  • Newt
  • Posts: 36
Re: New UCS on 3DSolid Face
« Reply #3 on: May 23, 2020, 08:45:15 AM »
Thanks MickD.
Very interesting ... and usefull !!!