CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedLISP DOES NOT WORK WITH AUTOCAD 2007 AND 2008

 Post Reply Post Reply
Author
YDYD View Drop Down
Newbie
Newbie


Joined: 24.Oct.2007
Location: Australia
Using: Autocad 2016
Status: Offline
Points: 1
Direct Link To This Post Topic: LISP DOES NOT WORK WITH AUTOCAD 2007 AND 2008
    Posted: 24.Oct.2007 at 08:47

hi. there

I have got lisp routine wich i used for many years staring with autocad R2000 but it does not work with R2007 and R2008,
help please.
 
 
;LTXT.LSP      Linetype Generator     (c)2001, Darren Marker

(defun
     C:LTXT ()
  (setvar "cmdecho" 0)
  (setq V:CLAYER (getvar "clayer"))
  (setq V:EXPERT (getvar "expert"))
  (if (not V:LINET)
    (setq V:LINET "XX")
  ) ;_ end of if
  (setq V:LINET_X
         (getstring
           (strcat
             "\n \n \nEnter line text: <"
             V:LINET
             ">"
           ) ;_ end of strcat
         ) ;_ end of getstring
  ) ;_ end of setq
  (if (/= V:LINET_X "")
    (setq V:LINET (strcase V:LINET_X))
  ) ;_ end of if
  (setq V:LINET (strcase V:LINET))
  (LT_MAKER)
) ;_ end of defun
(defun
     LT_MAKER ()
  (setvar "expert" 4)
  (setq V:LINET_L (strlen V:LINET))
  (setq V:LINET_W (rtos (* V:LINET_L 0.1) 2 1))
  (setq V:LT_FILE "c:\\temp\\lt_temp.lin")
  (setq V:LT_VAR1 (open V:LT_FILE "w"))
  (setq V:LT_TEXTL1
         (strcat
           "*" V:LINET "," V:LINET "----" V:LINET "----" V:LINET "----"
           V:LINET
          ) ;_ end of strcat
  ) ;_ end of setq
  (setq V:LT_TEXTL2
         (strcat
           "A,3.0,-0.2,["
           (chr 34)
           V:LINET
           (chr
             34
           ) ;_ end of chr
           ",SIMPLEX,S=0.1,R=0.0,X=-0.1,Y=-.05],-"
           V:LINET_W
         ) ;_ end of strcat
  ) ;_ end of setq
  (setq V:LT_VAR2 (write-line V:LT_TEXTL1 V:LT_VAR1))
  (setq V:LT_VAR3 (write-line V:LT_TEXTL2 V:LT_VAR1))
  (close V:LT_VAR1)
  (command "-linetype" "l" V:LINET V:LT_FILE "")
  (setvar "expert" V:EXPERT)
  (command ".celtype" V:LINET)
  (princ
    (strcat
      "\n \n \nCurrent Layer -"
      (getvar
        "clayer"
      ) ;_ end of getvar
    ) ;_ end of strcat
  ) ;_ end of princ
  (princ)
  (princ
    (strcat
      "\n \n \nCurrent Entity linetype set to:"
      V:LINET
    ) ;_ end of strcat
  ) ;_ end of princ
  (princ)
  (setq V:PNT1 (getpoint "\nPick start point:"))
  (command ".line" V:PNT1)
  (while
    (setq V:PT
           (getpoint
             (getvar "lastpoint")
             "\nNext point
             or <Return to
             terminate>:"
           ) ;_ end of getpoint
    ) ;_ end of setq
     (command V:PT)
  ) ;_ end of while
  (command)
  (command)
  (setvar "celtype" "bylayer")
  (princ)
  (princ
    "\n \nLine-Text terminated.  Linetype set to
             BYLAYER:"
  ) ;_ end of princ
  (princ)
) ;_ end of defun
(princ)
(princ " Line-Text Loaded...")
(princ)
(princ
  (strcat
    "\n \n"
    (chr 34)
    "LTXT"
    (chr 34)
    " to
             execute:"
  ) ;_ end of strcat
) ;_ end of princ
(princ)

 
Back to Top
dmarker View Drop Down
Newbie
Newbie


Joined: 08.Apr.2008
Location: United States
Status: Offline
Points: 1
Direct Link To This Post Posted: 08.Apr.2008 at 22:03
Hello.
I've tested the routine in AutoCAD 2008 and with a minor modification, I got it working as you are used to.
 
The change is in this line ",SIMPLEX,S=0.1,R=0.0,X=-0.1,Y=-.05],-"
Simply change the "SIMPLEX" to "STANDARD" and it should work great.
 
If you still have issues, feel free to contact me.  I can send you the .LSP file directly. 
 
When I wrote this little routine, it filled a huge gap in my AutoCAD daily tasks.  I'm happy that it's something that you've been using for years and want to continue.
 
Best regards,
Darren
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,109 seconds.