vsnap lisp

(DEFUN C:VSNAP (/)

; Sept. 25,97. By V.Mendez
; This function centers an object between two parallel lines.

(SETVAR “CMDECHO” 0)
(SETQ SelObj (ENTSEL “\nSelect Object : “))
(SETQ BPoint (GETPOINT “\nBase Point : “))
(COMMAND “OSNAP” “NONE”)
(COMMAND “OSNAP” “NEA”)
(SETQ Point1 (GETPOINT “\nFirst Point [nearest] : “))
(COMMAND “OSNAP” “PER”)
(SETQ Point2 (GETPOINT Point1 “\nSecond Point [Perpendicular] : “))
(COMMAND “OSNAP” “NONE”)
(SETQ X1 (CAR Point1)
Y1 (CADR Point1)
Z1 (CADDR Point1)
)
(SETQ X2 (CAR Point2)
Y2 (CADR Point2)
Z2 (CADDR Point2)
)
(SETQ XMid (/ (+ X2 X1) 2)
YMid (/ (+ Y2 Y1) 2)
ZMid (/ (+ Z2 Z1) 2)
)
(SETQ XObj (CAR BPoint)
YObj (CADR BPoint)
ZObj (CADDR BPoint)
)
(COND
((AND (= X1 X2) (= Y1 Y2)) (SETQ MidPoint (LIST XObj YObj ZMid)))
((AND (= X1 X2) (= Z1 Z2)) (SETQ MidPoint (LIST XObj YMid ZObj)))
((AND (= Y1 Y2) (= Z1 Z2)) (SETQ MidPoint (LIST XMid YObj ZObj)))
)
(COMMAND “MOVE” SelObj “” BPoint MidPoint)
(SETVAR “CMDECHO” 1)
)

Similar Posts

  • Programming

    AutoCAD Fast Lisp Scripts – library of AutoCAD shortcuts and scripts to speed up CAD drafting Legend Lisp – Create a legend of AutoCAD Entities AutoLisp Modes and Tables FLC Simulation in C and C++ Language MS Access Developer

  • Plocky Lisp

    (Defun FC (Func N Xo dx) ( (Setq LP ‘()) (Setq Int (/ dx N) (Setq x (-Xo Int)) (Repeat (+ N 1) (Setq x (+x Int)) (Setq y (FuncA x)) (Setq LPP (List x y)) (Setq LP (Cons LPP LP)) ) ) ) (Defun FuncA (V) (* V V) ) (Defun DrawF (ListP) (Setq…

  • FLC Simulation

    A computer simulation application that applies statistical mechanics to predict pre-synthesis of Liquid Crystal properties from chemical structure is needed. As well as the creation of calculation, videoand data manipulation tools and a user interface. read more …

  • MS Access Developer

    Help with design, development or repair of your Microsoft Access database. Some things about me: – 15 years of experience as an independent consultant for Access development projects – Many references. – Masters degree in Biostatistics. – Have taught business development at the Boulder Small Business Development Center. I can wrap my mind around just…

  • AutoCAD/MS Access Frontends with SQL Backend Integration

    AutoCAD/MS Access Frontends with SQL Backend Integration Problem: Each Sub-Department at the Utilities Department of the University of Colorado at Boulder have specific requirements for spatial and spatial data and often, there is an overlap of information crucial to these sub-departments; operations, maintenance, management, etc. Equipment data is stored and maintained in an SQL database…