BIGAL Posted May 7, 2022 Posted May 7, 2022 (edited) Like mhupp as you want trees, you could use a bounding box to get a Dia and replace with a tree symbol block using scale as width of box. Edited May 7, 2022 by BIGAL Quote
JensiLehmanni Posted May 7, 2022 Posted May 7, 2022 (edited) Hey Bigal, I guess this library is not included in AutoCAD. I need to focus on a workflow near to opensource, and dependent on as few paid software as possible (I'm still a Student). Since Civil 3D is more exoctic in Architecture Offices, I'm keen on AutoCAD. Still, this bounding box method is something I have to look at in the future, if applicable in AutoCAD. For now I'm happy with this bruteforce method ;-). Thanks for the Tip! Regards Edited May 7, 2022 by JensiLehmanni Quote
BIGAL Posted May 8, 2022 Posted May 8, 2022 (edited) Bounding box is a VL function, rather than pick 1 at a time would use a selection set of your polygons and convert. (vl-load-com) (setq obj (vlax-ename->vla-object (car (entsel "pick object ")))) (vla-GetBoundingBox obj 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) ;minpoint contains the minimum point of the bounding box ;maxpoint contains the maximum point of the bounding box Post a sample dwg with a few of the polygons. Edited May 8, 2022 by BIGAL Quote
dimitarrr Posted August 23, 2022 Posted August 23, 2022 I tried the update of mhupp - Insert Block at Block insertion point, but at the end I have an error. Error: too few actual parameters Quote
dimitarrr Posted August 23, 2022 Posted August 23, 2022 On 5/2/2022 at 8:25 PM, mhupp said: Update the first part ;; Insert Block at Block insertion point - Lee Mac (defun c:insblkcen ( / *error* blk box idx ref sel spc ) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (LM:startundo (LM:acdoc)) (if (and (setq blk (LM:selectifobject "\nSelect block to be inserted: " "INSERT")) (setq blk (LM:name->effectivename (cdr (assoc 2 (entget blk))))) (setq sel (LM:ssget (strcat "\nSelect blocks to insert \"" blk "\" at insertion point: ") '(((0 . "INSERT"))))) (setq spc (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))) ) (repeat (setq idx (sslength sel)) (if (setq ref (vlax-ename->vla-object (ssname sel (setq idx (1- idx))))) (vla-insertblock spc (vla-get-insertionpoint ref) (vla-get-rotation ref) ) ) ) ) (LM:endundo (LM:acdoc)) (princ) ) Quote
dimitarrr Posted August 25, 2022 Posted August 25, 2022 Can someone give an advice how to fix the error with too few actual parameters? Quote
j2lstaples Posted September 22, 2022 Posted September 22, 2022 So, with Lee-Mac's code it works superb for 2D but when I try to select 3D Polyface Meshes as my destination blocks, it seems to not like that and doesn't recognize my ssget. Quote
j2lstaples Posted November 7, 2022 Posted November 7, 2022 On 9/22/2022 at 1:54 PM, j2lstaples said: So, with Lee-Mac's code it works superb for 2D but when I try to select 3D Polyface Meshes as my destination blocks, it seems to not like that and doesn't recognize my ssget. I actually fixed it. Polyface Meshes doesn't have "INSERT". Lee Mac's codes inspired me to be creative for some of the functions in the workflow at my workplace. I actually used this as a reference for when trying to check if our generated 3D I-beams are populated at a certain height. Polyface Meshes are difficult to do manually because you have to properly click the line at the bottom. I've also allowed for it to work with actual 3D objects. I've generated a function for the PolyFace Meshes to actually calculate the center and minimum using bounding box vertices. Quote
GLORY Posted November 13, 2023 Posted November 13, 2023 @Lee Mac Hi Sir, is there a possibility to modify the lisp in order to put say for example a block named "NUMBER" at the center of a rectangle or while creating a rectangle the block named "NUMBER" will always be at the center regardless of the specified dimension the rectangle. Thank you. Quote
BIGAL Posted November 13, 2023 Posted November 13, 2023 You just make the rectang, use the midpoint of the 2 diag corners as insertion point. Adding to your counter each time. Look carefully each rectang has +1. Draw rectangs.mp4 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.