Jump to content

Initiate dragging a node on an object?


vanowm

Recommended Posts

Hello.

 

When you click on middle point of an arc you can drag it to change its shape. Is there a way initiate the same "dragging" of middle of an arc through autolisp? For example ask to select an arc, when user clicks anywhere on the arc its "snaps" middle of the arc to the cursor with ability use osnap

 

Thanks.

Link to comment
Share on other sites

I've seen grread, it's very universal and...complicated...I was hoping for something simpler, more specific to just grabbing a grip programmatically...

Link to comment
Share on other sites

You could save the snap settings to a variable, change the snap settings to midpoint only, select the arc and hope that the mid point is selected - if the user clicks too far away it might not snap to the mid point. Reset the snap settings using the variable from earlier - doing that a soon as practical in case of a LISP error or user cancels (assuming of course you'd also do this in an error defun but always worth doing it twice to be sure)

  • Agree 1
Link to comment
Share on other sites

vlax-curve- functions instead of snaps would be more reliable. or entsel the arc and calcualte the start pt end pt radius and center point to calculate the mid point.

  • Like 1
Link to comment
Share on other sites

Thought of that mhupp, calculate the mid point and snap to there - but you the rules I have about checking things out at the weekend, not so sure I could explain the next steps after arc selection without checking some code

Link to comment
Share on other sites

This is what I use when I want a fillet but don't know the exact size of the radius. You select an existing arc, circle, or arc on a polyline and pull its radius.

 

;;----------------------------------------------------------------------------;;
;; Apply the radius of a selected curved object to the Fillet command
(defun C:RR (/ pt r)
  (if (and (setq pt (cadr (entsel "Select Curve: "))) 
           (setq r (distance (osnap pt "nea") (osnap pt "cen")))
      )
    (progn
      (setvar 'filletrad r)
      (vl-cmdf "_.fillet" "M")
    )  
    (prompt "\nNo Radius Found.")
  )
  (princK)
)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...