Author Topic: Create Object on 3d Solid face  (Read 1354 times)

0 Members and 1 Guest are viewing this topic.

matthewj

  • Newt
  • Posts: 42
  • Vanilla
Create Object on 3d Solid face
« on: May 07, 2012, 09:48:03 PM »
I am hitting a wall with the latest project I've been working on.  Its an opendcl tap hole creator, and it works fine as is, but I'd like to create the circles on the surfaces of 3d solids.  I'm not even sure where to start with this problem.  The only user input is from a getpoint, and I'm not sure if there is a way to create the circles that uses the dynamic ucs data, or gets the moused-over ucs or what-have-you.

I'm at a loss, and I'm hoping there's a "oh yeah, just use this function" answer.  If its more involved, I'm more than willing to do some learnin' - I'm just requesting a push in the right direction to get me going.  As always, thanks much (in advance) for any help you may be willing to throw my way.

I've included the part of the code that creates the circles, so you have context.

Code: [Select]
defun c:tap ( / *error* done tmp )

(dcl_Project_Load "Tap" T)
(dcl_project_import project nil nil)

;error handling removed for brevity

(defun tap_prompt (/)
(prompt (strcat "\n" current_tap "    Hidden=" (vl-registry-read tap_masterKey "hidden")))
(prompt "\nSelect Centerpoints or [Change/Hidden/eXit]: ")
)

   (tap_prompt)
   (while (/= done 1)
   
    (setvar "cmdecho" 0)
    (initget 128 "Finish Change Hidden eXit")
    (setq answer (getpoint))
   
    (cond
    ((and (listp answer) (= 3 (length answer)))
    ;;TODO: insert better circle creation and modifier method later
    (vlax-invoke model 'addcircle answer (/ (cdr (assoc current_tap tap_table)) 2))
    (if (= (vl-registry-read tap_masterKey "hidden") "on")
    (progn
    (vlax-invoke model 'addcircle answer (/ (cdr (assoc current_tap hidden_table)) 2))
    (command "chprop" (entlast) "" "ltype" "hidden2" "color" "44" "")
    )
    )
    )
    yada yada yada...