Jump to content

Recommended Posts

Posted

Does anyone know of or can help me create a lisp that will copy or offset a block from a basepoint to a particular length following a polyline with arcs and lines?

Posted

Actually you can not make offset of a block, Copy command would do it instead.

 

What do you mean by - following a polyline with arcs and lines ?

 

Tharwat

Posted

Give this a try .....

(defun c:Cblk (/ sel ent basePT )
(if (setq sel (entsel "\nSelect a Block to copy :"))
   (if (= (cdr (assoc 0 (entget (car sel)))) "INSERT")
     (progn
       (setq ent (entget (car sel))
      basePT (cdr(assoc 10 ent)
	       )
    )
        (command "_.copy" sel "" basePT pause)
     )
   (Alert "Only a Block must be selected")
   )
  (alert "Nothing selected")
  )
     (princ)
)

 

Tharwat

Posted
Does anyone know of or can help me create a lisp that will copy or offset a block from a basepoint to a particular length following a polyline with arcs and lines?

Investigate the use of the Measure and/or Divide command

Posted

Alright, I am going to describe what I mean with the help of some screenshots.

This first shot is to show you the line I am dealing with.

 

1.jpg

 

This second shot shows a total length of the line.

 

2.jpg

 

 

I wil continue to edit this until I get what I need.

Posted

Search for Alan's CopyAlongCurve.lsp :) It should do your bidding.

Posted

OK, I will go no further explaining my scenario. Alan's routine is exactly what I was looking for.

Thank you Lee Mac.

 

I am going to post the link to it so if anyone is searching for the same thing and come across this post they don't have to search for it.

 

http://www.cadtutor.net/forum/showthread.php?46309-CopyAlongCurve.LSP-Divide-Measure-Dynamic&highlight=CopyAlongCurve.lsp

Posted (edited)

OK. I guess alan's routine is almost what I am looking for. The only thing it doesn't do correctly is keep the base point in dynamic mode. It copies it from the previous point. Are there any other lisp's that are like this that I can play with?

 

When I copy it along the curve I need it to keep the original base point picked. I get a running line of measurements and every point is based off a "0" point. For example my first point is 131', my second point is 162', my third point is 198', and so on. All measurements are based off of a zero point.

Edited by toberino
Posted
Give this a try .....

(defun c:Cblk (/ sel ent basePT )
(if (setq sel (entsel "\nSelect a Block to copy :"))
(if (= (cdr (assoc 0 (entget (car sel)))) "INSERT")
(progn
(setq ent (entget (car sel))
basePT (cdr(assoc 10 ent)
)
)
(command "_.copy" sel "" basePT pause)
)
(Alert "Only a Block must be selected")
)
(alert "Nothing selected")
)
(princ)
)

 

Tharwat

 

I tried this one out to see what it did but it acts kind of funny. Can you explain to me what you use it for and how to best utilize it? Thanks.

Posted
Actually it is as fun as your question in the beginning . :)

 

Post #8 explains what I am trying to accomplish.

Posted
Investigate the use of the Measure and/or Divide command

 

How goes your investigation? :?

Posted
How goes your investigation? :?

 

Investigating now...I thought I had my answer already but I was wrong.

Posted

Alright, it looks like the measure command places nodes or blocks on the entire length of the object spacing them apart the amount you choose.

The divide command will place a node or block with equal spacing depending on how many equal parts I want.

 

Are there more features involded in these commands that I am not aware of?

Posted
Alright, it looks like the measure command places nodes or blocks on the entire length of the object spacing them apart the amount you choose.

The divide command will place a node or block with equal spacing depending on how many equal parts I want.

 

Are there more features involded in these commands that I am not aware of?

 

Great question.

 

... What has been your experience?

 

... What options have you used?

 

... When you tried these commands, did either of them do what you wanted?

Posted
Great question.

 

... What has been your experience?

 

... What options have you used?

 

... When you tried these commands, did either of them do what you wanted?

 

I will play this game because I am a perfectionist.

 

1.) I have never used these commands.

 

2.) The options that are presented at the command line.

 

3.) No.

 

Alan's lisp does do what I want but in order for it to work properly I have to start the lisp over for each point. When I am dealing with hundreds of points I need speed to be a factor. I need a slimmed down version only including the dynamic action and will copy from the original base point picked instead of going from the last point placed.

Posted (edited)

Why doesn't Measure work for you?

 

Looks like you might have to try writing your own...

hint... (vlax-curve-GetPointAt Dist...)

Edited by lpseifert
Posted
Why doesn't Measure work for you?

 

Looks like you might have to try writing your own...

hint... (vlax-curve-GetPointAt Dist...)

 

Measure does not work because it drops nodes at the spacing specified in the command following the entire length of the line or curve. My spacing is all different. So if my line is 9" long and I enter 2", it puts a node every 2" across the entire length of the line. My situation, hypothetically speaking, needs a node at 1.5", then 3.5", then 4", then 6.3", from the base point or zero point. All being measured from one direction.

 

And yes, I believe you are correct. I think it's time for me to head to the tutorial section and learn how to write this lisp. I've been lucky enough to find the codes for everything else I have needed. Now I guess it's time to get my hands dirty. I have been looking forward to this....thanks lp for suggesting it.

Posted

...

I think it's time for me to head to the tutorial section and learn how to write this lisp. I've been lucky enough to find the codes for everything else I have needed. Now I guess it's time to get my hands dirty. I have been looking forward to this...

 

Great initiative! The determination doesn't hurt either! Happy coding...! :D

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