Jump to content

how to place block on curve line plz


afrazawan

Recommended Posts

I have almost what you want it draws a block along a pline its in VBA what you do is take the start or end and attach it to the arc you then use intersectwith to work out other end point and rotate block. You can also use a chord length calc and the angle of the tangent points to work out the statrt and end points. I do not have start with the mid pt of block for any arc. Sure some one will post.

 

Bit odd same question http://www.cadtutor.net/forum/showthread.php?87387-hi-all-i-want-align-block-with-curve

Link to comment
Share on other sites

If you are not familiar on how to use lisp you can use the following method

 

 

Use "Measure" select the curve, then type "B" for block and enter the name of your block (in your case br2)

type "Y" for yes to align the block and specify the length of segments (which will be block length + distance between)

hope this will help you

 

or Use divide if you know how many block you need on the curve

Link to comment
Share on other sites

Problem still not solved Cant understand If I use Measure " command then should be a block reference point eg. mid or side any one but suppose my block ref. point is mid of block ME command will align my block on curve with this point.

plz I can use LISP but there is no any Lisp.plz look at my attached dwg.

Link to comment
Share on other sites

I use this LISP command but Unfortunately this command is not helpfull we can place block on curve with one side alignment how to arrange Side B on curve plz?

Link to comment
Share on other sites

You have a block.

 

You have a curve.

 

You want multiple instances of the block positioned on the curve separated by a distance of 0.02.

 

Sounds like a job for the Array command using the Path option (hint: Items). No lisp required.

Link to comment
Share on other sites

Try this but your block in the dwg is scaled why did you do that ? Also this is not quite right you will need a block with the insert pt at mid on left side.

 

 

; this will draw a single block as you requested
; this is just the start
; rad is length of block
(setq rad 4.02)
(setq pickobj (entsel "\nPick arc :"))
(setq obj1 (vlax-ename->vla-object (car pickobj)))
(setq pt (cadr pickobj))
(command "circle" pt rad) ; rad is your block length 
(setq pickobj1 (entlast))
(setq obj2 (vlax-ename->vla-object (car pickobj1)))
(setq intpt1 (vlax-invoke obj2 'intersectWith obj1 acExtendThisEntity))
(setq pt (list (nth 0 intpt1)(nth 1 intpt1)))
(setq pt2 (list (nth 3 intpt1)(nth 4 intpt1)))
(command "erase "L" "") ; dummy circle
(setq ang (angle pt pt2))
(command "-insert" "br2" pt 1 "" ang) 

Edited by BIGAL
scaled + rad added
Link to comment
Share on other sites

Proof it can be done using the ARRAY command. I also used the PATH, ALIGN and ITEMS options.

 

BarrierArray1.jpg

 

BarrierArray2.jpg

 

BarrierArray3.PNG

 

BTW...if you use a distance of 4.02 between items along the path the actual measured distance between midpoints of rectangles turns out to be .0197 which some may consider close enough for government work. If it really needs to be .02 then use a distance of 4.0203 (see, I figured it out for you).

 

As you can see by the last image there will be a much smaller gap at the top and a much larger gap at the bottom.

Link to comment
Share on other sites

how to use this code please need more help

Try this but your block in the dwg is scaled why did you do that ? Also this is not quite right you will need a block with the insert pt at mid on left side.

 

 

; this will draw a single block as you requested
; this is just the start
(setq pickobj (entsel "\nPick arc :"))
(setq obj1 (vlax-ename->vla-object (car pickobj)))
(setq pt (cadr pickobj))
(command "circle" pt rad) ; rad is your block length 
(setq pickobj1 (entlast))
(setq obj2 (vlax-ename->vla-object (car pickobj1)))
(setq intpt1 (vlax-invoke obj2 'intersectWith obj1 acExtendThisEntity))
(setq pt (list (nth 0 intpt1)(nth 1 intpt1)))
(setq pt2 (list (nth 3 intpt1)(nth 4 intpt1)))
(command "erase "L" "") ; dummy circle
(setq ang (angle pt pt2))
(command "-insert" "br2" pt 1 "" ang) 

Link to comment
Share on other sites

  • 2 weeks later...

Please help me how to use array i'm not much familiar with this command.

 

 

Proof it can be done using the ARRAY command. I also used the PATH, ALIGN and ITEMS options.

 

[ATTACH=CONFIG]51047[/ATTACH]

 

[ATTACH=CONFIG]51048[/ATTACH]

 

[ATTACH=CONFIG]51049[/ATTACH]

 

BTW...if you use a distance of 4.02 between items along the path the actual measured distance between midpoints of rectangles turns out to be .0197 which some may consider close enough for government work. If it really needs to be .02 then use a distance of 4.0203 (see, I figured it out for you).

 

As you can see by the last image there will be a much smaller gap at the top and a much larger gap at the bottom.

aa.jpg

Link to comment
Share on other sites

Array objects along a path curve in AutoCAD. Search on this topic. There is a video tutorial by cadalystvideos that explains how the command/option works.

 

To make things easier, I located my block at the beginning of the curve using the ALIGN command for the best results. Then use the distance between Items I previously posted.

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