Results 1 to 5 of 5

Thread: Level cross

  1. #1
    Join Date
    Mar 2020
    Posts
    3

    Level cross

    Hi,

    I have a LISP that creates a Z value and cross on points picked. The problem is that the cross that is created is rotated 45 deg ( x ). I would like it come in square to world UCS ( + ) or if possible as block. Below is by current routine. Many thanks Ben

    (defun ctlab (/ Text _PromptWithDefault _Cross Pt pos)
    ;; Lee Mac ~ 30.03.10

    (defun Text (pt hgt str)
    (entmakex (list (cons 0 "TEXT") (cons 10 pt)
    (cons 40 hgt) (cons 7 (getvar 'TEXTSTYLE))
    (cons 1 str))))

    (defun _PromptWithDefault (f arg d)
    (cond ((apply f arg)) (d)))

    (defun _Cross (p h / l)
    (setq l (sqrt (* 0.5 h h)))
    (mapcar
    (function
    (lambda (p1 p2)
    (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))))

    (list (polar p (/ pi 4.) l)
    (polar p (/ (* 3 pi) 4.) l))

    (list (polar p (/ (* 5 pi) 4.) l)
    (polar p (/ (* 7 pi) 4.) l))))

    (setq *Coord* (cond (*Coord*) ("Y"))
    *tHgt* (cond (*tHgt* ) ((getvar 'TEXTSIZE)))
    *thOff* (cond (*thOff*) (1.0))
    *tvOff* (cond (*tvOff*) (1.0))
    *cSze* (cond (*cSze* ) ((getvar 'TEXTSIZE))))

    (setq pos '(("X" . 0) ("Y" . 1) ("Z" . 2)))

    (initget "X Y Z")
    (mapcar (function set) '(*Coord* *tHgt* *thOff* *tvOff* *cSze*)
    (mapcar (function _PromptWithDefault) '(getkword getdist getdist getdist getdist )
    (list (list (strcat "\nSpecify Coord to Label [X/Y/Z] <" *Coord* "> : "))
    (list (strcat "\nSpecify Text Height <" (rtos *tHgt*) "> : "))
    (list (strcat "\nSpecify Horizontal Text Offset <" (rtos *thOff*) "> : "))
    (list (strcat "\nSpecify Vertical Text Offset <" (rtos *tvOff*) "> : "))
    (list (strcat "\nSpecify Cross Height <" (rtos *cSze*) "> : ")))
    (list *Coord* *tHgt* *thOff* *tvOff* *cSze*)))

    (while (setq pt (getpoint "\nPick Point to Label <Exit> : "))
    (_Cross (setq pt (trans pt 1 0)) *cSze*)

    (Text (polar (polar pt 0. *thOff*) (/ pi 2.) *tvOff*) *tHgt*
    (rtos (nth (cdr (assoc *Coord* pos)) pt))))

    (princ))

  2. #2
    Join Date
    Jan 2008
    Location
    English Lake District
    Posts
    2,869
    Sorry we don't have any lisp guru's here.

    I suggest that you ask on CADTutor where there are some very knowledgeable lisp experts. Including Lee Mac who wrote that one.
    https://www.cadtutor.net/forum/forum...-lisp-amp-dcl/

    As it's one of Lee's he should be ably to modify it for you quite easily, or may already have one that does as you want.
    Last edited by NukeCad; 29-03-2020 at 11:02 AM.
    Im intelligent enough to know that I dont know everything; but I'll tell you all about it anyway.

  3. #3
    Join Date
    Mar 2020
    Posts
    3
    Perfect - thanks

    I will try now

  4. #4
    Join Date
    Jan 2008
    Location
    English Lake District
    Posts
    2,869
    I just noticed that it was one of Lee Mac's lisps, so have edited my post above.
    Im intelligent enough to know that I dont know everything; but I'll tell you all about it anyway.

  5. #5
    Join Date
    Mar 2020
    Posts
    3
    Perfect - thanks

    I will try now

Similar Threads

  1. Replies: 3
    Last Post: 05-10-2012, 10:41 AM
  2. Find A Specific Level Point Along An Object?!?
    By Mhej2305 in forum AutoCAD 2007 Help
    Replies: 3
    Last Post: 06-08-2008, 04:01 PM
  3. Cross hairs don't work
    By ~Dramatic~Details~ in forum AutoCAD 2006 Help
    Replies: 3
    Last Post: 05-11-2006, 06:41 PM
  4. Ucs And Cross Hairs
    By nmoxey in forum AutoCAD 2006 Help
    Replies: 2
    Last Post: 22-06-2006, 09:07 PM
  5. Cross Hair
    By pcarfoot in forum Screens, Mice, Plotters etc
    Replies: 4
    Last Post: 03-03-2006, 02:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •