
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning,
I'm back with this weird thing happening.
I'm measuring distance from a point on XY and the imprint of a line from that point (200 units tall) with a solid tall 152.40 units.
Strangely in my computer works just fine measuring 152.40 and on other two computers it shows 200.
I think OSNAP is not snapping on the solid on theirs, but checked the options and they look the same to me.
Can anyone help? Thanks in advance.
below is my code:
(defun C:DAVIDE(/ var val p c solidSS ent linevar)
(setq var '("Osmode" "Expert")
val (mapcar 'getvar var))
(mapcar 'setvar var '(0 1))
; TURN OFF SOLID LAYER
(command "_.-layer" "OFF" "IMAGINARY SURFACE" "" "")
; ENTER LAT, LON OF THE POINT OF INTEREST
(command "geomarklatlong" PAUSE PAUSE " ")
; SELECT NODE JUST CREATED
(setq p (cdr (assoc 10 (entget(ENTLAST)))))
; DRAW LINE 200 UNITS TALL ORTHO TO XY FROM NODE
(command "_.line" p (list (car p) (cadr p) (+ (caddr p) 200)) "")
(setq linevar (ssget "_L"))
(mapcar 'setvar var val)
; TURN ON SOLID LAYER
(command "_.-layer" "ON" "IMAGINARY SURFACE" "")
; IMPRINT LINE WITH SOLID
(setq solidSS (ssget "X" (list '(0 . "3DSOLID")(cons 8 "IMAGINARY SURFACE")))) ; this will get a selection set containing the solid
(setq ent (ssname solidSS 0)) ; retrieve first entity in the list (there should be only 1)
(command "_.imprint" ent linevar "_Y" "")
; SELECT IMPRINTED POINT
(setq c (getvar "lastpoint"))
; CALCULATE DISTANCE FROM ORIGINAL POINT TO THE IMPRINTED POINT
(command "dist" p c)
(if (> (getvar 'distance) 152.40)
(alert (strcat "Error"))
(alert (strcat "Max heigth is : " (rtos (getvar 'distance) 2 3) " mt or " (rtos (* 3.2808399 (getvar 'distance)) 2 3) " ft")))
(princ)
)
Solved! Go to Solution.