Leaderboard
Popular Content
Showing content with the highest reputation on 03/19/2022 in all areas
-
This is my take on the problem I am struggling with how to pass this block name to the RB code. You pass the entity name not block name. Try this works for A-Z etc ; rename a block. ; uses lee-mac CopyRenameBlockV1-5.lsp which needs to be modified to pass entity and block name ; so give it a new name say CopyRenameBlockV1-5-1.lsp (defun c:wow ( / obj x atts att chrnum num) (if (not LM:RenameBlockReference)(load "CopyRenameBlockV1-5-1")) (setq ss (ssget "x" '((0 . "INSERT") (2 . "REVB")))) (setq num 0) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (setq atts (vlax-invoke obj 'Getattributes)) (setq chrnum (ascii (vla-get-textstring (car atts)))) (if (> chrnum num)(setq num chrnum)) ) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (setq atts (vlax-invoke obj 'Getattributes)) (if (= num (ascii (vla-get-textstring (car atts)))) (LM:RenameBlockReference nil (ssname ss x) "VREVB") ) ) (princ) ) (c:wow) Lee's code is always excellent and I have made a few changes to get the extra options to work, it may be something that Lee will add the option of passing entity and new name, as say version 1-6 CopyRenameBlockV1-5-1.lsp2 points
-
1 point
-
It is not an arrogance, everyone always appreciates praise when they have helped - which you do do. Maybe I took your comment the wrong way - as a thanks but also a criticism - perhaps lost the meaning with the typed word on the screen - which is the basis of my comment - it is better than doing it all manually.1 point
-
Thank you very much for all your help. Very much appreciated This will save me lots of work! Initially I made a real school boy error and left the (c;wow) on the end of the code, which caused the vlide to go crazy when loading. The c:wow routine works well and perfectly selected the correct block and supplied the new block name but required a last carriage return to complete the input. Not sure if I have done wrong but I then edited Lees code and added the line from SteveP (many thanks) which removed the getstring and supplies the new block name “VREVB”. Again, I am not sure if I have violated good code practice but I then put the entire routine into one lsp file called CopyRenameBlockV1-5-1 (see attached) so all is loaded together. We use the CB and RB functions regularly so I will need to be careful not to get these mixed/overwritten. Thank you both again for all your help, please let me know if I have done anything terrible with the above modifications? Regards John CopyRenameBlockV1-5-1.lsp1 point
-
Currently, the maximum image size is 1200px x 1200px. Files larger than this are uploaded and then auto-reduced in size. However, it looks like the software is struggling to reduce the dimensions of animated GIF files. Obviously, I need to balance the ease of use for users with storage capacity, but am happy to increase the current maximum if you think it will provide a better user experience1 point
-
It should still return a point unless mixing up the order create parallel lines. granted its not the point your looking for. How are these points being defined? That's where the sorting should take place. so then you can use inters to get the correct point. If its always a rectangle that is horizontal use bounding box (setq rec (vlax-ename->vla-object (car (entsel "\nPick Rectangle")))) (vla-getboundingbox rec 'minpt 'maxpt) (setq P1 (vlax-safearray->list minpt) ;lower left P4 (vlax-safearray->list maxpt) ;upper right p3 (list (car LL)(cadr UR)) p2 (list (car UR)(cadr LL)) )1 point
-
So just checking, your routine is asking for lisp routine tai However to put this into Lee Macs rename, get the block entity name and replace src with that Replace this line with your selected block entity. (setq src (car (entsel (strcat "\nSelect block reference to " (if cpy "copy & " "") "rename: ")))) and replace this line (and (/= "" (setq new (getstring t (strcat "\nSpecify new block name <" def ">: ")))) with (and (/= "" (setq new "VREVB")) I think that will work, if you can fnd tai lisp then probably be able to put this all together for you1 point
-
It is not a piece of cake at all for me at least Try to specify the first point on the right hand side and the second one on the left side hand to avoid the orientation of the texts ' angles . (defun c:Test (/ entities i number integer layers lst object point1 p st height point2 result selectionset selectionsetname singlelayer space table r c inc ang ) (vl-load-com) ;;; Tharwat 15. May. 2012 ;;; (if (not char1) (setq char1 65 char2 66 ) (setq char1 (+ char1 2) char2 (+ char2 2) ) ) (if (> char2 90) (setq char1 65 char2 66 ) ) (if (and (setq point1 (getpoint "\n Specify first point :")) (setq point2 (getpoint point1 "\n Specify Second point :")) (setq selectionset (ssget "_F" (list point1 point2) '((0 . "LINE,*POLYLINE")) ) ) (setq p (getpoint "\n Table insertion point :")) ) (progn (vl-cmdf "_.pline" "_non" point1 "_non" point2 "") (setq height (if (zerop (cdr (assoc 40 (setq st (entget (tblobjname "STYLE" (getvar 'textstyle)) ) ) ) ) ) (cdr (assoc 42 st)) (cdr (assoc 40 st)) ) ) (entmakex (list '(0 . "TEXT") (cons 40 (* height 3.)) (cons 10 (polar point1 (setq ang (angle point2 point1)) (* height 1. ) ) (cons 50 ang) (cons 1 (chr char1)) ) ) (entmakex (list '(0 . "TEXT") (cons 40 (* height 3.)) (cons 10 (polar point2 (setq ang (angle point1 point2)) (* height 3.5) ) ) (cons 50 (angle point2 point1)) (cons 1 (chr char2)) ) ) (repeat (setq integer (sslength selectionset)) (setq entities (cons (setq selectionsetname (ssname selectionset (setq integer (1- integer)) ) ) entities ) ) (if (not (member (setq singlelayer (cdr (assoc 8 (entget selectionsetname))) ) layers ) ) (setq layers (cons singlelayer layers)) ) ) (setq i 0) (foreach layer layers (repeat (setq number (length entities)) (if (eq (cdr (assoc 8 (entget (nth (setq number (1- number)) entities)) ) ) layer ) (setq lst (cons layer (setq i (1+ i)))) ) ) (setq result (cons lst result)) (setq i 0) ) (setq space (if (> (vla-get-activespace (setq acdoc (vla-get-activedocument (vlax-get-acad-object) ) ) ) 0 ) (vla-get-modelspace acdoc) (vla-get-paperspace acdoc) ) ) (setq table (vla-addtable space (vlax-3d-point p) (1+ (length result)) 2 (* height 2.) (* height 10.) ) ) (vla-settext table 0 0 (strcat "Section " (chr char1) " " (chr 45) " " (chr char2)) ) (setq r 0 c 0 inc -1 ) (repeat (length result) (vla-settext table (setq r (1+ r)) c (car (nth (setq inc (1+ inc)) result)) ) (vla-setcellalignment table r c acMiddleCenter) (vla-settext table r (setq c (1+ c)) (itoa (cdr (nth inc result))) ) (vla-setcellalignment table r c acMiddleCenter) (setq c 0) ) ) ) (princ) )1 point
-
This one is much more better with a table . (defun c:Test (/ entities i number integer layers lst object point1 p height point2 result selectionset selectionsetname singlelayer model table r c inc ) (vl-load-com) ;;; Tharwat 15. May. 2012 ;;; (if (and (setq point1 (getpoint "\n Specify first point :")) (setq point2 (getpoint point1 "\n Specify Second point :")) (setq selectionset (ssget "_F" (list point1 point2) '((0 . "LINE,*POLYLINE")) ) ) (setq p (getpoint "\n Table insertion point :")) ) (progn (setq height (if (zerop (cdr (assoc 40 (setq st (entget (tblobjname "STYLE" (getvar 'textstyle)) ) ) ) ) ) (cdr (assoc 42 st)) (cdr (assoc 40 st)) ) ) (repeat (setq integer (sslength selectionset)) (setq entities (cons (setq selectionsetname (ssname selectionset (setq integer (1- integer)) ) ) entities ) ) (if (not (member (setq singlelayer (cdr (assoc 8 (entget selectionsetname))) ) layers ) ) (setq layers (cons singlelayer layers)) ) ) (setq i 0) (foreach layer layers (repeat (setq number (length entities)) (if (eq (cdr (assoc 8 (entget (nth (setq number (1- number)) entities)) ) ) layer ) (setq lst (cons layer (setq i (1+ i)))) ) ) (setq result (cons lst result)) (setq i 0) ) (setq model (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)) ) ) (setq table (vla-addtable model (vlax-3d-point p) (1+ (length result)) 2 (* height 2.) (* height 10.) ) ) (vla-settext table 0 0 "Section A - B") (setq r 0 c 0 inc -1 ) (repeat (length result) (vla-settext table (setq r (1+ r)) c (car (nth (setq inc (1+ inc)) result)) ) (vla-settext table r (setq c (1+ c)) (itoa (cdr (nth inc result))) ) (setq c 0) ) ) ) (princ) )1 point
-
-1 points