Print Page | Close Window

lisps in german/oth​er language

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=6150
Printed Date: 16.Jul.2026 at 21:15


Topic: lisps in german/oth​er language
Posted By: germanbarry
Subject: lisps in german/oth​er language
Date Posted: 27.Jun.2011 at 11:31
I recently started working in germany and have my CAD installed in english, so all the lisps I used in Australia work fine. I wanted to share some lisps I use with some colleagues, but of course they don't work due to the language barrier as their CAD/machines are in german, mine in english.
attached are the few that i use.
 
I've only ever downloaded and used lisps, so don't know exactly how the script is written and/or exactly what needs to be edited to get it to work in BOTH languages (or to change the lisp to just work in german if both languages can't work from the one script), but if you know what needs changing from any of these scripts it'd be much appreciated!
 
primarily the PLJOIN lisp - they are licking their lips here at that command!
Note: The TLEN lisp attached seems to work on german machines... no idea why, but thought it might be important to share.
 
 
***edit***
From help: "Images can be added to your posts, if the forum administrators have allowed uploading..."
guess I'll have to wait to upload the lisps. if you can help either way, let me know!!



Replies:
Posted By: Vladimir Michl
Date Posted: 27.Jun.2011 at 11:45
You can upload files using the Reply button (full, not the Quick reply).
 
As for the language - make sure your LISP code call the globalized command names (and options) - e.g. "_CIRCLE", not "CIRCLE"; "_Cen", not "Cen".


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: germanbarry
Date Posted: 27.Jun.2011 at 12:48
what i don't understand is why the TLEN works in both languages but the others don't - the TLEN has english-only code:
 
(defun C:TLEN (/ ss tl n ent itm obj l)
  (setq ss (ssget)
        tl 0
        n (1- (sslength ss)))
  (while (>= n 0)
    (setq ent (entget (setq itm (ssname ss n)))
          obj (cdr (assoc 0 ent))
          l (cond
              ((= obj "LINE")
                (distance (cdr (assoc 10 ent))(cdr (assoc 11 ent))))
              ((= obj "ARC")
                (* (cdr (assoc 40 ent))
                   (if (minusp (setq l (- (cdr (assoc 51 ent))
                                          (cdr (assoc 50 ent)))))
                     (+ pi pi l) l)))
              ((or (= obj "CIRCLE")(= obj "SPLINE")(= obj "POLYLINE")
                   (= obj "LWPOLYLINE")(= obj "ELLIPSE"))
                (command "_.area" "_o" itm)
                (getvar "perimeter"))
              (T 0))
          tl (+ tl l)
          n (1- n)))
  (alert (strcat "Total length of selected objects is " (rtos tl)))
  (princ)
)
 
compared to the SELLAY lisp (below), I can't seem to find many commands that need the understrike beforehand... these two examples are the copy/paste text from the (english) functioning lisps. The SELLAY one below looks rather simple/small, so if anyone knows where to make the edits, please do so and highlight somehow so i can see what to look for. The lisp for pljoin is huge though, so i dunno how I'd go when locating all of those amendments, esp since you don't know where the lsp falls down when it does.
 
(defun C:SELLAY ( / e ss i)
 (setq i (ssget "_I"))
 (setq e (nentsel "Select entity on a layer: "))
 (if e (setq ss (ssget (if i "_I" "_X") (list(cons 8 (cdr (assoc 8 (entget (car e)))))))))
 (if (zerop (getvar "CMDACTIVE"))
  (progn (sssetfirst ss ss)(princ "Use 'P' for this selection set: ")(princ))
   ss
 )
)
(defun C:SELLAYS ( / e lay ss layl i)
 (setq i (ssget "_I"))
 (setq layl ""  ss (ssadd))
 (while (setq e (nentsel "\nSelect entity on a layer <exit>: "))
  (setq layl (strcat layl "," (cdr (assoc 8 (entget (car e))))))
  (princ (substr layl 2))
 );while
 (setq layl (substr layl 2))
 (if (> layl "") (setq ss (ssget (if i "_I" "_X") (list (cons 8 layl)))))
 (if (zerop (getvar "CMDACTIVE"))
  (progn (sssetfirst ss ss)(princ "Use 'P' for this selection set: ")(princ))
   ss
 )
)
(princ "\nXanadu SELLAY + SELLAYS commands loaded.")(princ)


Posted By: Vladimir Michl
Date Posted: 27.Jun.2011 at 13:00
I didn't notice first that you were talking about our LISP utilities. All of our tools should work fine in any language version of AutoCAD.
 
There may be localization/globalization bugs in specific AutoCAD versions - this may cause that some tools fail. In this case I would suspect the "_I" and "_X" options. Try to use plain "I" and "X" instead (we have not specifically tested German AutoCAD).


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: germanbarry
Date Posted: 27.Jun.2011 at 13:29
aaaarrgh!
sorry for wasting your time, but i just realised that the TLEN lisp was the only one which worked because it was the only one i dragged into my CAD window! my fecking brain must have assumed i dragged all of them in and was confused as to why the rest weren't working...
 
 
thanks for the support either way!



Print Page | Close Window