Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/17/2020 in all areas

  1. CadTutor Tutorials: https://www.cadtutor.net/tutorials/autocad/index.php?category_id=25 Also search Youtube. There are lots of videos: https://www.youtube.com/results?search_query=autocad+3d
    1 point
  2. Autocad has a Z dimension that is vertical with relation to the traditional 2d coordinate system (X, Y). There are multiple ways of modeling objects in 3D in Autocad. Check out the tutorials section of the website and scroll down to "3D Basics". That should get you pointed in the right direction. There are tons of Autocad 3D modeling videos and walkthroughs online also. -ChriS
    1 point
  3. Like Emmanuel if preloaded. (defun c:ASR (from to / ss i atts blk a tag val newval) remove (setq from "AZERTY") remove (setq to "QUERTY") open dwg1 (c:asr "AZERTY" "QUERTY") close Y open dwg2 (c:asr "AZERTY" "QUERTY") close Y open dwg3 (c:asr "AZERTY" "QUERTY") close Y
    1 point
  4. Rlx has done the answer but a list of lists may be usefull for other than "PV". Using lee's LM:str->lst (("PV1" 2 2)("PV2" 6 6) ("PV3" 8 10))
    1 point
  5. oh darn , too late again... awell... (defun SplitStr ( s d / p ) (if (setq p (vl-string-search d s))(cons (substr s 1 p) (SplitStr (substr s (+ p 1 (strlen d))) d)) (list s))) (defun istext (s)(if (= (type s) 'str) t nil)) (defun plc (p l c)(entmakex (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline")(cons 8 l)(cons 90 (length p))(cons 70 c))(mapcar '(lambda (pt) (cons 10 pt)) p)))) (defun t1 (sl / pl )(and (vl-consp sl)(vl-every 'istext sl)(vl-every '(lambda (x)(wcmatch x "*;*;*")) sl) (vl-consp (setq pl (mapcar '(lambda (x)(mapcar 'atoi (cdr (SplitStr x ";")))) sl))) (plc pl "0" 0))) ; test : (t1 '("PV1;2;2" "PV2;6;6" "PV3;8;10"))
    1 point
  6. You could use a function such as my String to List function to convert the string to a list using a supplied token, for example: (defun c:desenha2 ( / des lst str txt ) (if (setq txt (getfiled "Esse é o título da cx de diálogo" (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname))) "txt" 8)) (if (setq des (open txt "r")) (progn (while (setq str (read-line des)) (setq lst (cons (LM:str->lst str ";") lst)) ) (close des) (if (setq lst (vl-remove nil (mapcar (function (lambda ( i / n x y ) (if (and (wcmatch (car i) "PV*") (setq n (atoi (substr (car i) 3))) (setq x (distof (cadr i) 2)) (setq y (distof (caddr i) 2)) ) (list n 10 x y) ) ) ) lst ) ) ) (entmake (append (list '(000 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length lst)) '(070 . 0) ) (mapcar 'cdr (vl-sort lst '(lambda ( a b ) (< (car a) (car b))))) ) ) ) ) (princ "\nUnable to open file for reading.") ) (princ "\n*Cancel*") ) (princ) ) ;; String to List - Lee Mac ;; Separates a string using a given delimiter ;; str - [str] String to process ;; del - [str] Delimiter by which to separate the string ;; Returns: [lst] List of strings (defun LM:str->lst ( str del / pos ) (if (setq pos (vl-string-search del str)) (cons (substr str 1 pos) (LM:str->lst (substr str (+ pos 1 (strlen del))) del)) (list str) ) ) (princ)
    1 point
  7. Hi, An example of how to convert a list of strings to a list of coordinates based on your list if your list is always with the same form. (foreach str '("PV1;2;2" "PV2;6;6" "PV3;8;10") (setq lst (cons (read (strcat "(" (vl-string-translate ";" "," (substr str 5)) ")")) lst)) ) You need to reverse the list afterwards.
    1 point
×
×
  • Create New...