128 lines
3.9 KiB
Common Lisp
128 lines
3.9 KiB
Common Lisp
(Defun C:BEMHPASS ()
|
|
(Setvar "Cmdecho" 0)
|
|
(Setq AN1 0 AN2 (* Pi 0.5) AN3 (* Pi 1.5)
|
|
BM (Getvar "Blipmode") DS (Getvar "Dimscale") DA (* DS (Getvar "Dimasz"))
|
|
DT (* DS (Getvar "Dimtxt")) DE (* DS (Getvar "Dimexe"))
|
|
DO (* DS (Getvar "Dimexo"))
|
|
)
|
|
(Setq P1 (Getpoint
|
|
"\nFirst Point of the first Construction-Line or RETURN to select: "))
|
|
(Cond
|
|
((= nil P1)
|
|
(Setq P2 (Entsel))
|
|
(While
|
|
(= nil P2)
|
|
(Princ "\nNo object found!")
|
|
(Setq P2 (Entsel))
|
|
)
|
|
(Setq P2 (Osnap (Cadr P2) "MIT"))
|
|
(Setq P1 (Osnap P2 "END"))
|
|
(Setq P2 (Polar P1 (Angle P1 P2) (* 2.0 (Distance P1 P2))))
|
|
)
|
|
((Boundp 'P1)
|
|
(Initget 1)
|
|
(Setq P2 (Getpoint "\nFirst Point of the second Construction-Line: "))
|
|
)
|
|
)
|
|
(Initget 1)
|
|
(Setq P3 (Getpoint "\nPlace Dimensioning-Line: "))
|
|
(Setvar "Blipmode" 0)
|
|
(Setq P4 (Inters P1 (Polar P1 AN2 1) P3 (Polar P3 AN1 1) Onseg))
|
|
(Setq P5 (Inters P2 (Polar P2 AN2 1) P3 (Polar P3 AN1 1) Onseg))
|
|
(Setq P3 (Polar P4 (Angle P4 P5) (/ (Distance P4 P5) 2)))
|
|
(If
|
|
(< (Cadr P4) (Cadr P1))
|
|
(Setq F -0.5)
|
|
(Setq F 0.5)
|
|
)
|
|
(Command "_LINE" (Polar P1 (Angle P1 P4) DO) (Polar P4 (Angle P1 P4) DE)
|
|
"" "_LINE" (Polar P2 (Angle P2 P5) DO) (Polar P5 (Angle P2 P5) DE)
|
|
"" "_LINE" P4 P5 ""
|
|
)
|
|
(Setq P3 (Polar P3 (Angle P1 P4) (* F DT)))
|
|
(Setq D1 (Rtos (Distance P4 P5) (Getvar "Lunits") (Getvar "Luprec")))
|
|
(Command "_Solid" P4 (Polar (Polar P4 (Angle P4 P5) DA) AN3
|
|
(* DA (/ 1.0 6.0))) (Polar (Polar P4 (Angle P4 P5) DA) AN2
|
|
(* DA (/ 1.0 6.0))) "" ""
|
|
)
|
|
(Command "_Solid" P5 (Polar (Polar P5 (Angle P5 P4) DA) AN3
|
|
(* DA (/ 1.0 6.0))) (Polar (Polar P5 (Angle P5 P4) DA) AN2
|
|
(* DA (/ 1.0 6.0))) "" ""
|
|
)
|
|
(Prompt "\nDimensioning-Text <")
|
|
(Prompt D1)
|
|
(Setq D2 (Getstring t ">: "))
|
|
(If
|
|
(= D2 "")
|
|
(Setq D D1)
|
|
(Setq D D2)
|
|
)
|
|
(Command "_Text" "Z" P3 DT 0 D)
|
|
(Setvar "Blipmode" BM)
|
|
(Princ)
|
|
)
|
|
|
|
(Defun C:BEMVPASS ()
|
|
(Setvar "Cmdecho" 0)
|
|
(Setq AN1 (* Pi 0.5) AN2 0 AN3 Pi
|
|
BM (Getvar "Blipmode") DS (Getvar "Dimscale") DA (* DS (Getvar "Dimasz"))
|
|
DT (* DS (Getvar "Dimtxt")) DE (* DS (Getvar "Dimexe"))
|
|
DO (* DS (Getvar "Dimexo"))
|
|
)
|
|
(Setq P1 (Getpoint
|
|
"\nFirst Point of the first Construction-Line or RETURN to select: "))
|
|
(Cond
|
|
((= nil P1)
|
|
(Setq P2 (Entsel))
|
|
(While
|
|
(= nil P2)
|
|
(Princ "\nNo object found!")
|
|
(Setq P2 (Entsel))
|
|
)
|
|
(Setq P2 (Osnap (Cadr P2) "MIT"))
|
|
(Setq P1 (Osnap P2 "END"))
|
|
(Setq P2 (Polar P1 (Angle P1 P2) (* 2.0 (Distance P1 P2))))
|
|
)
|
|
((Boundp 'P1)
|
|
(Initget 1)
|
|
(Setq P2 (Getpoint "\nFirst point of the second construction line: "))
|
|
)
|
|
)
|
|
(Initget 1)
|
|
(Setq P3 (Getpoint "\nPlace dimensioning line: "))
|
|
(Setvar "Blipmode" 0)
|
|
(Setq P4 (Inters P1 (Polar P1 AN2 1) P3 (Polar P3 AN1 1) Onseg))
|
|
(Setq P5 (Inters P2 (Polar P2 AN2 1) P3 (Polar P3 AN1 1) Onseg))
|
|
(Setq P3 (Polar P4 (Angle P4 P5) (/ (Distance P4 P5) 2)))
|
|
(If
|
|
(< (Car P4) (Car P1))
|
|
(Setq F -0.5)
|
|
(Setq F 0.5)
|
|
)
|
|
(Command "_LINE" (Polar P1 (Angle P1 P4) DO) (Polar P4 (Angle P1 P4) DE)
|
|
"" "_LINE" (Polar P2 (Angle P2 P5) DO) (Polar P5 (Angle P2 P5) DE)
|
|
"" "_LINE" P4 P5 ""
|
|
)
|
|
(Setq P3 (Polar P3 (Angle P1 P4) (* F DT)))
|
|
(Setq D1 (Rtos (Distance P4 P5) (Getvar "Lunits") (Getvar "Luprec")))
|
|
(Command "_Solid" P4 (Polar (Polar P4 (Angle P4 P5) DA) AN3
|
|
(* DA (/ 1.0 6.0))) (Polar (Polar P4 (Angle P4 P5) DA) AN2
|
|
(* DA (/ 1.0 6.0))) "" ""
|
|
)
|
|
(Command "_Solid" P5 (Polar (Polar P5 (Angle P5 P4) DA) AN3
|
|
(* DA (/ 1.0 6.0))) (Polar (Polar P5 (Angle P5 P4) DA) AN2
|
|
(* DA (/ 1.0 6.0))) "" ""
|
|
)
|
|
(Prompt "\nDimensioning text <")
|
|
(Prompt D1)
|
|
(Setq D2 (Getstring t ">: "))
|
|
(If
|
|
(= D2 "")
|
|
(Setq D D1)
|
|
(Setq D D2)
|
|
)
|
|
(Command "_Text" "Z" P3 DT 90 D)
|
|
(Setvar "Blipmode" BM)
|
|
(Princ)
|
|
)
|
|
|