Jump to content

Recommended Posts

Posted

Hi Lee

 

Sorry for asking you but realy I stacked

I finished the lisp just whay I want is filling the table with point

Could you please help me?

 

;
;                                  subroutine
(defun Gen_PointBlock ()
   (entmake '((0 . "BLOCK") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbBlockReference") (2 . "Planning-Point") (10 0 0 0) (70 . 0)))
   (entmake '((0 . "CIRCLE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (62 . 7) (100 . "AcDbCircle") (10 0 0.0 0) (40 . 0.1)))
   (entmake '((0 . "LINE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (62 . 7) (100 . "AcDbLine") (10 -0.15 0.15 0) (11 0.15 -0.15 0)))
   (entmake '((0 . "LINE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (62 . 7) (100 . "AcDbLine") (10 -0.15 -0.15 0) (11 0.15 0.15 0)))
   (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
   (princ)
   ); end Pointblock
 (defun Gen_Layer ()
   (entmake (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 "EC-TEXT-22-SCALE") (cons 70 0) (cons 62 10)))
   (entmake (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 "EC-SYMBOL") (cons 70 0) (cons 62 13)))
   (princ)
   ); end layer
(defun *error* (msg)
   (if oldEcho (setvar "CMDECHO" oldEcho))
   (if oSnp (setvar "OSMODE" oSnp))
   (if oZin (setvar "DIMZIN" oZin))
   (if mSp (vla-EndUndoMark actDoc))
   (princ)
 ); end of *error*
(defun Gen_Table ()
 (setq tab-Pnt (getpoint "\nPick Table insertion point"))
 (setq vlaTab(vla-AddTable mSp (vlax-3D-point tab-Pnt)
                           (+ 2 num:Num)
                           4
                           (* 4 (getvar "DIMTXT"))
                           (* 14 (getvar "DIMTXT")))
       r 2
       lCnt 0
       tLst '((1 0 "Point")(1 1 "X")(1 2 "Y")(1 3 "Rematks")))
 );end Gen_Table
     ;;;
 ;    EndSubroutine    

 ;                        mainroutine    
     ;;;
 (defun c:EC-COORD (/ Pnt:Lst)
 (vl-load-com)
   (Gen_Layer)
   (Gen_PointBlock)
   (setq OldDynmode (getvar "dynmode")
         OldDynprompt (getvar "dynprompt")
  OldEcho (getvar "cmdecho")
         OZin (getvar "DIMZIN")
         )
   (if(not num:Size)(setq num:Size(getvar "DIMTXT"))) 
   (if(not num:Pref)(setq num:Pref "")) 
   (if(not num:Suf)(setq num:Suf "")) 
   (if(not num:Num)(setq num:Num 1)) 
   (setq oldPref num:Pref 
         oldSuf num:Suf 
         oldStart num:Num 
         oldSize num:Size 
         actDoc(vla-get-ActiveDocument
                 (vlax-get-acad-object))
         mSp(vla-get-ModelSpace actDoc)
         oldEcho(getvar "CMDECHO")
         );End of setq
   (setvar "cmdecho" 0)
   (setvar "DIMZIN" 0)
 (initget "Meter MILLImeter")
 (setq Dwg:Unts (getkword "\nWhat is drawing units? [Meter/MILLImeter]: "))

 (if (= Dwg:Unts "Meter")
   (progn
     (command "_.-style" "EC-22-0.01" "romans.shx" 0.22 "0.8" "0" "n" "n" "n")
     (setvar "DIMTXT" 0.22)
     (setq BlkScl 1.0)
     ))
 (if (= Dwg:Unts "MILLImeter")
   (progn
     (command "_.-style" "EC-22-100" "romans.shx" 220 "0.8" "0" "n" "n" "n")
     (setvar "DIMTXT" 220)
     (setq BlkScl 1000.0)
     ))
 (if(not num:Pref)(setq num:Pref "")) 
 (if(not num:Suf)(setq num:Suf "")) 
 (if(not num:Suf)(setq num:Suf "")) 

 (if(null num:Size)(setq num:Size oldSize)) 

 (setq num:Pref (getstring T (strcat "\nPrefix: <"num:Pref">: "))) 
 (if(= "" num:Pref)(setq num:Pref oldPref)) 
 (if(= " " num:Pref)(setq num:Pref "")) 
 (setq num:Suf (getstring T (strcat "\nSuffix: <"num:Suf">: "))) 
 (if(= "" num:Suf)(setq num:Suf oldSuf)) 
 (if(= " " num:Suf)(setq num:Suf "")) 
 (setq num:Num (getint (strcat "\nStarting number <"(itoa num:Num)">: ")))
 (if(null num:Num)(setq num:Num oldStart))

 (princ "\n<<< Insert numbers then press Enter to insert table and quit >>> ")
   (while 
     (progn
(setq curStr (strcase (strcat num:Pref(itoa num:Num)num:Suf))
             NumPnt (getpoint "\nPick Point ")
             NumPont (list (- (car NumPnt) (* 3 (getvar "DIMTXT"))) (+ (cadr NumPnt) (* 3 (getvar "DIMTXT"))) (caddr NumPnt))
             NumPontLst (list (list curStr (car NumPnt) (cadr NumPnt)) NumPontLst))

(entmakex ;pointText
         (list (cons 0 "TEXT") (cons 1 curStr) (cons 7 (getvar "textstyle")) (cons 8 "EC") (cons 10 NumPont) (cons 11 NumPont) (cons 40 (getvar "DIMTXT")) (cons 50 45) (cons 72 1) (cons 73 2)))
(entmakex ;Pointblock
         (list (cons 0 "INSERT") (cons 2 "Planning-Point") (cons 8 "EC-SYMBOL") (cons 10 NumPnt) (cons 41 BlkScl) (cons 42 BlkScl) (cons 43 BlkScl)))
       (setq num:Num(1+ num:Num))
       ); end of progn
      ); end while
   (Gen_Table)
   (princ "http:\\www.a-a-econstruct.com ")
   (princ "Type EC-COORD to run. ")
 ); end of Defun

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...