Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/21/2020 in all areas

  1. Easily solved. Try this version. (defun c:moveco ( / dst ent obj tmp ss cnt elst i_pt c_pt ang o_ang) (initget 7) (setq dst (getreal "\nEnter Distance to Move : ") ent (car (entsel "\nSelect Polyline : ")) obj (vlax-ename->vla-object ent) tmp (car (vlax-invoke obj 'offset dst)) );end_setq (cond ( (> (vlax-get tmp 'area) (vlax-get obj 'area)) (setq dst (* dst -1.0)))) (vla-delete tmp) (prompt "\nSelect Circles : ") (setq ss (ssget ":L" '((0 . "CIRCLE")))) (cond (ss (setq tmp (car (vlax-invoke obj 'offset dst))) (repeat (setq cnt (sslength ss)) (setq ent (ssname ss (setq cnt (1- cnt))) elst (entget ent) i_pt (reverse (cdr (reverse (cdr (assoc 10 elst))))) c_pt (vlax-curve-getclosestpointto tmp i_pt) ang (angle i_pt c_pt) );end_setq (setq o_ang (fix (/ ang (* pi 0.5)))) (if (> (rem ang (* pi 0.5)) (* pi 0.25)) (setq o_ang (* (1+ o_ang) (* pi 0.5))) (setq o_ang (* o_ang (* pi 0.5)))) (if (minusp dst) (setq c_pt (polar i_pt (+ o_ang pi) dst)) (setq c_pt (polar i_pt o_ang dst))) (entmod (subst (cons 10 c_pt) (assoc 10 elst) elst)) );end_repeat (vla-delete tmp) ) );end_cond );end_defun
    1 point
  2. Like Marco not sure perp or at a parallel offset, any way why not use ssget "F" circle gets center points straight away and pline. SSget circle will find any others not on pline if not carefully selected. 1 perp get 1st deriv at pt then polar +90 move circle. May need +- clockwise. 2 do offset internal and use closest point to for move.
    1 point
  3. Yes it's concise, but how I understood first picture : you want circles moved othogonal and not perpendicular to offset (look top edge of polyline)... Sorry to disappoint you but I think you'll need other method...
    1 point
  4. @amir0914 Just noticed a bug. Have updated above code
    1 point
×
×
  • Create New...