Philipp Posted June 19, 2022 Share Posted June 19, 2022 Hello! For calculating lenghts for distributions Id like to have a lisp that writes the "delta-x + delty-y" as lenght from an base-point (best here would be a base-point-block that can be moved and rotated, so you can varia the axis rotation) into selected blocks. 1. select blocks to measure the length to (set their x and y) 2. select base point with rotation-attribute (go from x till x is the blocks in right angle and add the delta y) 3. Write the summed length in an attribute each block has like "Length = "x+y" mm" Anyone see a good reference for this or knows how to write it down fast? I can post blocks later if that helps! FG Quote Link to comment Share on other sites More sharing options...
mhupp Posted June 20, 2022 Share Posted June 20, 2022 Can you upload a sample drawing? not really understanding what your looking for. 1. overall length and width of a block. (vla-getboundingbox (vlax-ename->vla-object blk) 'minpt 'maxpt) (setq ptslst (cons (vlax-safearray->list minpt) ptslst) ptslst (cons (vlax-safearray->list maxpt) ptslst) ) (setq LL (apply 'mapcar (cons 'min ptslst)) UR (apply 'mapcar (cons 'max ptslst)) L&W (mapcar '- UR LL) ) Quote Link to comment Share on other sites More sharing options...
exceed Posted June 20, 2022 Share Posted June 20, 2022 18 hours ago, Philipp said: 2. select base point with rotation-attribute (go from x till x is the blocks in right angle and add the delta y) i cannot understand this point. i think base point is point, rotation is rotation. you want pick point and set angle? or pick block and get it's block base point and block roation value? Quote Link to comment Share on other sites More sharing options...
Philipp Posted June 21, 2022 Author Share Posted June 21, 2022 Thanks for the reply! I meant the base pont and rotation value. As an attachment I made a drawing to show what I like to automate. The help lines demonstrate what Id like to measure. The steps should work like: 1. Chose starting point 2. Chose objects (one or more at a time) 3. Read out the rotation of the starting point and measure the direct lines in right angle to the objects 4. Write the lenght of the measured lines into the attribute "lenght" for each block (but sum up, even if the direction goes in negative direction) I got another nice lisp here to filter blocks in a drawing by attribute or attribute value, so this would be a great achievment to calculate masses for electrical distribution Friendly greets Philipp example.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 22, 2022 Share Posted June 22, 2022 (edited) This has been answered many times uses VL getpointclosestto and getpointatdist, the only issue I see is you say "select object" so what are the objects are they always block and if so measure to the insertion point ? Please confirm and I am sure either code will appear or a link to solution. Edited June 22, 2022 by BIGAL Quote Link to comment Share on other sites More sharing options...
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.