Author Topic: Vla-offset clockwise vs counter clock wise  (Read 1525 times)

0 Members and 1 Guest are viewing this topic.

ChrisCarlson

  • Guest
Vla-offset clockwise vs counter clock wise
« on: August 18, 2014, 07:52:07 AM »
I have the following snipped within my script

Code: [Select]
(progn
(setq pt(getpoint"\nSpecify first corner point"))
(command "pline" pt)
(while pt
(setq pt(getpoint pt"\nEnter next point, or return to close:"))
(if (or (not pt)(= pt "c"))
(progn(command"close")(setq pt nil))
) ; end if
(command pt)
)
(setq hrev_del (ssget "_L"))
(hrev)
(vl-cmdf "_.erase" hrev_del "")
) ;end progn

Code: [Select]
(defun hrev ( / )
(if (= hrev_arcsize "D")
(progn
(vlax-for o (setq s (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))))
(vla-Offset o -0.125))
(setq hrev_layer  (ssget "_L"))
(if (tblsearch "LAYER" "Revision")
(progn
(vl-cmdf "._revcloud" "a" "1/4" "1/4" ""(ssget "_L") "")
(vl-cmdf "_.chprop" (ssget "_L") "" "LA" "Revision" "")
)
(princ "Layer Not Found??")
) ; end if
)
(progn
(vlax-for o (setq s (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))))
(vla-Offset o -0.09375))
(setq hrev_layer  (ssget "_L"))
(if (tblsearch "LAYER" "Revision")
(progn
(vl-cmdf "._revcloud" "a" "1/8" "1/8" ""(ssget "_L") "")
(vl-cmdf "_.chprop" (ssget "_L") "" "LA" "Revision" "")
)
(princ "Layer Not Found??")
) ; end if
)
)
)

I know small things like localizing variables needs to be cleaned up BUT I cant seem to figure out why making the poly line counter clockwise the vla-offset, offsets correctly but making the polyline clockwise causes the offset to occur opposite (+ instead of -). Do I need to include a catch for the direction of polyline or a catch to reverse the polyline?

//update
Doh! Definitely have to adjust the offset based on direction.
« Last Edit: August 18, 2014, 08:18:00 AM by ChrisCarlson »