Jump to content

distribution lenght measurement


Philipp

Recommended Posts

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

Link to comment
Share on other sites

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)
)

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by BIGAL
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...