G'day Guys
I have a problem with getting the distance from a users. I am trying to take 3 things into concideration.
1. User will input 2 points in model space
2. User will input 2 points in paperspace
3. User will input the value.
Basicly trying to replicate "Getdist" function with it working in paper space.
Attached is my code.
Code:
(defun Sub_GetDistance (Str_Msg / Pt_Point1 Pt_Point2)
(if
(and
(not (vl-catch-all-error-p (setq Pt_Point1 (vl-catch-all-apply 'getpoint (list Str_Msg)))))
Pt_Point1
(not (vl-catch-all-error-p (setq Pt_Point2 (vl-catch-all-apply 'getpoint (list Pt_Point1 "\nSelect second point :")))))
Pt_Point2
)
(if
(and ;If all true measuring item in paper space through v port
(zerop (getvar "tilemode"))
(not (zerop (getvar "cvport")))
(setq Pt_Point1 (trans Pt_Point1 2 0)
Pt_Point2 (trans Pt_Point2 2 0))
(equal Pt_Point1 (osnap Pt_Point1 "_End,_Int,_Qua,_Cen,_Mid,_Node"))
(equal Pt_Point2 (osnap Pt_Point2 "_End,_Int,_Qua,_Cen,_Mid,_Node"))
)
(distance (trans Pt_Point1 3 2)(trans Pt_Point2 3 2)) ;This only uses the latest view port created
(distance Pt_Point1 Pt_Point2)
)
)
)
Bookmarks