Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/11/2019 in all areas

  1. The above expression will evaluate to 2 for every iteration, and hence the code will modify the block at selection set index 0 and 2 only. Instead, either use the code provided by @dlanorh or change the above expression to: (setq i (1+ i))
    1 point
  2. You are not incrementing "i" properly. (1+ 1) will always = 2. Use (setq i (1+ i)) or try (defun c:Teste (/ tagname blockname) (setq tagname "REL" blockname "Teste") (setq ss (ssget '((0 . "INSERT")(66 . 1)))) (repeat (setq i (sslength ss)) (setq blk (ssname ss (setq i (1- i)))) (LM:vl-SetAttributeValue (vlax-ename->vla-object blk) tagname blockname) ) (princ) )
    1 point
  3. >> Why does my selection set only work on the first block and does not run on the others? Because of this: (setq ss (ssname ss i)) What you're doing, is overwriting ss. ss used to be your whole selection, but the instant you execute this line of code ss now means the first block. You should put this in another variable. for example: (setq blk (ssname ss i)) (LM:vl-SetAttributeValue (vlax-ename->vla-object blk) "tag" "value") Also ... "tag" "value", this is weird. This means the value "value" gets set. What you want is (LM:vl-SetAttributeValue (vlax-ename->vla-object blk) tag value) This means the value "ITEM1", or "ITEM2" ... gets set. Also, DEMO doesn't do what you want it to do. But I'll stop here, for now.
    1 point
  4. My apologies, I forgot to include the second argument determining whether nested blocks should be burst - I have updated my earlier post.
    1 point
  5. Try the attached. (defun c:enz (/ clr key pnt dim a b c) ;; Tharwat - 5.Jul.2019 ;; (load "enz.lsp") enz ;; https://www.cadtutor.net/forum/topic/68126-require-lisp-3-in-1-for-xyz-coordinates-with-leader/?tab=comments#comment-552696 (setq clr (getvar 'clayer)) (cond ( (null (tblsearch "LAYER" "Coor Text")) (command "-layer" "_M" "Coor Text" "_C" 7 "" "")) (t (setvar 'clayer "Coor Text"))) (and (or (initget "NoZ All Z") (setq key (cond ((getkword "\nPick your go [No Elevation , All Coordinates , Z coordinates only] [NoZ/All/Z] < NoZ > :" ) ) ("NoZ") ) ) ) (setq pnt (getpoint "\nSpecify base point : ")) (while pnt (setq dim (getvar 'DIMZIN)) (setvar 'DIMZIN 0) (mapcar 'set '(a b c) (mapcar '(lambda (k p) (strcat k (rtos p 2 4))) '("E=" "N=" "Z=") pnt ) ) (setvar 'DIMZIN dim) (command "_.LEADER" "_none" pnt "\\" "" (nth (vl-position key '("NoZ" "All" "Z")) (list (strcat a "\\P" b) (strcat a "\\P" b "\\P" c) c) ) "" ) (setq pnt (getpoint "\nSpecify base point : ")) ) ; while ) (setvar 'clayer clr) (princ) )
    1 point
  6. So company policy is dont buy something that may improve company production and improve profit Hint search here triangulation.
    1 point
×
×
  • Create New...