Jump to content

Recommended Posts

Posted (edited)

Need someone to get this tool to crash for a test and get me to find solution.

Had this previously using no entmake or trans but seems to work now.

 

(defun c:4x  (/ *error* pt1 pt2 ss  )
(princ (strcat "\n 45"(chr 186)"/135"(chr 186)" 3D.XLines <!pp>"))

  (defun *error* ( msg )
     (setvar 'cmdecho 0)    
   (vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
      (if msg (prompt (strcat "\n" msg)))
        (setvar 'cursorsize 100)    ;; reset to my prefer
     (setvar 'cmdecho 1)    
 (princ)
  )
    
  (setvar 'cursorsize 1)
  
  (entmakex ;;                  <LM
   '(
        (000 . "LAYER")
        (100 . "AcDbSymbolTableRecord")
        (100 . "AcDbLayerTableRecord")
        (002 . "XLINE")      ;; Layer Name
        (070 .  0)           ;; Layer Status     (bit-coded)
        (006 . "Continuous") ;; Layer Linetype   (must be loaded)
        (062 .  252)          ;; Layer Colour     (1-255)
        (290 .  0)           ;; Non-Plot Flag    (0=Plot, 1=NoPlot)
        (370 . -3)           ;; Layer Lineweight (-3=Default)
    )
) 

   (defun zPoint ( / exv) ;; 3d point mfg
      (setq pt1 (trans pt1 1 0))
      (setq exv (trans (list 0 0 1) 1 0 T))
      (entmakex (list (cons 0 "POINT")
      (cons 10 pt1)
      (cons 210 exv)))
    )

   (defun cdd ()
      (princ "\n")
        (princ 
          (setq pp                               ;;  make/prints coords & paste usable
                  (strcat 
                     (rtos (car pt1) 2 4) ","        ;; 'p' -- vertex from pgm /\ getpoint,...
                     (rtos (cadr pt1) 2 4) ","
                     (rtos (caddr pt1) 2 4) 
                    )
                 )
        ) 
   (princ " cucs ");;    ;   (entmakex (list (cons 0 "POINT") (cons 10 pt))) ;; clean point 
                 
  (setenv "pp" pp) ;; crash saved coords
 )

;;// -----------------------------------------------------------------------------------------------------------
      ;; Get the initial placement point
(while (setq pt1 (getpoint "\nSpecify Point for XLines: "))
(setvar 'cmdecho 0)
    (progn
      ;; Create a new empty selection set
      (setq ss (ssadd))
      
      ;; Create horizontal xline and add to selection set
      (command "_.xline" "_a" 45 pt1 "")
      (command "chprop" "_L" "" "la" "XLINE" "") ;; make xline grey
      (ssadd (entlast) ss)
      
      ;; Create vertical xline and add to selection set
      (command "_.xline" "_a" 135 pt1 "")
       (command "chprop" "_L" "" "la" "XLINE" "") ;; make xline grey
     (ssadd (entlast) ss)
     (cdd) ;; post coords
    (zPoint) ;; point at 'pick.point
    )
(setvar 'cmdecho 1) 
  ) ;; end of while
  
  (princ)
)

 

Edited by ScottMC
forgot variable..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...