Author Topic: 3dsolid Face Midpoint  (Read 260 times)

0 Members and 1 Guest are viewing this topic.

ScottMC

  • Newt
  • Posts: 51
  • ...if we don't ask, we won't receive..
3dsolid Face Midpoint
« on: May 11, 2020, 03:44:21 PM »
Here's a quickie.. 
  Got this code working except it declines/ignores on including the sides or non-WCS faces resulting in the point in the wrong spot and orientation. The desire is to put a point [for snap] at the center of a solid face. Running A2K. Currently my tool [2 point circle] prompts for two points, draws a circle then converts the circle into a point. Option would be to prompt selection of a face to switch the UCS to the Solid Face, as I use when editing a solid side, requiring a "shift-to-deselect" which would work excellent, then get the point to have a better OSD to use in the command. Just to DEEP for me. Thanks 
Code: [Select]
(defun c:scp  (/ e i s osm)
  (setvar 'cmdecho 0)
  (setq osm (getvar 'osmode))
  (setvar 'osmode 7)
  (princ "\n   Draw Point at Center: <Select Two Snaps:>")
  (vl-cmdf "circle" "2P" pause pause)
;(command)
;(if (setq s (ssget "_:L" '((0 . "CIRCLE"))))
  (setq s (ssget "L"))
  (repeat (setq i (sslength s))
    (setq e (ssname s (setq i (1- i))))
    (if (entmake (list '(0 . "POINT") (assoc 10 (entget e))))
      (entdel e)
      )
    )
  (setvar 'cmdecho 1)
  (setvar 'osmode osm)
  (princ)
  )
« Last Edit: May 11, 2020, 04:00:30 PM by ScottMC »

DEVITG

  • Bull Frog
  • Posts: 438
Re: 3dsolid Face Midpoint
« Reply #1 on: May 12, 2020, 07:12:14 PM »
Please upload such sample.dwg
Location @ Córdoba Argentina Using ACAD 2019  at Window 7

roy_043

  • Water Moccasin
  • Posts: 1778
  • BricsCAD 18
Re: 3dsolid Face Midpoint
« Reply #2 on: May 13, 2020, 02:34:31 AM »
Maybe try this line:
(vl-cmdf "_.point" "_m2p" pause pause)

ScottMC

  • Newt
  • Posts: 51
  • ...if we don't ask, we won't receive..
Re: 3dsolid Face Midpoint
« Reply #3 on: May 25, 2020, 07:42:25 PM »
Closer to perfection.. Got it working but would rather it be a cleaner operation as far as "Next" flip included with the UCS Face tool offers. When I try to do a "Next" face, it replies with:

Command:
SCP Select Face for Center Point:
Yes or No, please.

Yes or No, please.


SCP Unknown command "SCP".  Press F1 for help.


In the above, I hit "enter/rt-clk" four times then allows me to finish and completes correctly.
What do I do to get it to accept the "next"?
Thanks to any who can help!

« Last Edit: May 25, 2020, 08:44:00 PM by ScottMC »