Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/12/2021 in all areas

  1. I just started to learn lisp and mostly am copy-pasting and checking one by one. I do not have a programing background or anything like that so please help me to understand. Last time I make something I need. It was successfully I finished. Please tell me if there is any mistake or your suggestion And if you can put your way for the same task that may be I can understand very well on new things (while (progn (setq entldr nil enttxt nil) (if (setq sel(LM:ssget "\nSelect Text & leader: " (list "_:L" (list '(000 . "TEXT,MTEXT,LEADER") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model") ) ) ) ) ) (progn (cond ( (< 2 (sslength sel)) (princ "\nThe selection have more than 2 object") ) ( (= 1 (sslength sel)) (progn (cond ( (not (wcmatch(cdr (assoc 0(entget(ssname sel 0))))"TEXT,MTEXT")) (princ "\nThe selection don't have text") ) ( (not (wcmatch(cdr (assoc 0(entget(ssname sel 0))))"LEADER")) (princ "\nThe selection don't have leader") )) ) ) ( (= 2 (sslength sel)) (progn (repeat (setq i (sslength sel)) (or (not (entget (setq ent (ssname sel (setq i (1- i)))))) (if (not (wcmatch(cdr (assoc 0(entget ent)))"TEXT,MTEXT")) (setq entldr ent) (setq enttxt ent))) ) (cond ( (= entldr nil) (princ "\nThe selection have multiple text") ) ( (= enttxt nil) (princ "\nThe selection have multiple leader") ) ) ) ) ) ) ) ) )
    1 point
  2. Always happy to help, as you have me, getting used to ProSteel. I really like this feature, Ease Of Access settings in Windows 10
    1 point
  3. 1 point
  4. Hi, Give a try on this set method: (setq i 0) (while (and (setq s (getstring "\nString : ")) (/= s "") ) (set (read (strcat "Name" (itoa (setq i (1+ i))))) s) ) Test on commandline: String : S1 String : S2 String : S3 Results: _2_$ name1 "S1" _2_$ name2 "S2" _2_$ name3 "S3"
    1 point
  5. Well, its "end justities the means" then. As long as you're happy with it then go for it. Im more inclined to code it this way. (Not caring about the X position) (defun c:MoveY ( / ss i e atb r e) (vl-load-com) (if (setq ss (ssget "_:L" '((0 . "INSERT") (66 . 1)))) (repeat (setq i (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (cond (and (setq atb (assoc "RL" (mapcar '(lambda (j) (list (vla-get-tagstring j) (distof (vla-get-textstring j)))) (vlax-invoke e 'Getattributes)))) (setq r (cdr (assoc 10 (entget (ssname ss i))))) (vla-put-insertionpoint e (vlax-3d-point (list (car r) (+ (cadr atb) )))))) ) )(princ) ) Ideally the block insertion point should be the datum point. it wouldnt be that hard to include "X" value if the blocks are created the way i suggested. At any rate... study the code and feel free to modify to your liking. Cheers
    1 point
×
×
  • Create New...