Jump to content

Lisp that draws a line and offsets next line a centerline and next a solid 2" apart??


Recommended Posts

Posted

I was hoping someone out there knows how to use a lisp in one command that can allow our firm to draw a single solid line that automatically offsets a 2" centerline followed by another 2" offset solid line...If it's easier something like drawing a centerline using midpoint offset by two solid lines would absolutely work. The closest I found was the following code that allows you to offset a specified distance and only after you've drawn the line..and there all the same linetype. Our engineering firms uses this command SO much and it's just a bit more tedious bring in a block then stretching/extending/trimming it. Your help is GREATLY appreciated.

 

 

(defun c:dOff1 ( / *error* of undo doc ss )

(vl-load-com)

 

(defun *error* ( msg )

(and undo (vla-EndUndomark doc))

(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")

(princ (strcat "\n** Error: " msg " **")))

(princ)

)

 

(if (and (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))

(setq of (getdist "\nSpecify Offset Distance: ")))

(progn

(setq undo

(not

(vla-StartUndomark

(setq doc

(vla-get-ActiveDocument

(vlax-get-acad-object)

)

)

)

)

)

 

(vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))

(mapcar

(function

(lambda ( o )

(vl-catch-all-apply

(function vla-offset) (list obj o)

)

)

)

(list of (- of))

)

)

(vla-delete ss)

 

(setq undo (vla-EndUndoMark doc))

)

Posted

I don't quite understand what the final outcome looks like. Can you post an image? -David

Posted

absolutely. Here's hopefully what the final outcome will look like

beamhdr.jpg

Posted

If you were just drawing straight lines, then have you tried the Multi Line command?

MultiLine.jpg

Posted

Thanks Lee, It's helpful but similar issues to the code I previously posted..I never heard of multi lines! All the lines will be straight..I'm off to discover the simplicity of creating them! Thanks Eldon

Posted

Do you want to draw the center line and then offset others, or are you say you want to draw the ( wall ), then the center then the opposite wall line? -David

Posted

I have to say thanks again eldon! Really appreciate it! Everything worked perfect.

Posted

It would have been the first one david..though the multi line command works perfect..Would prefer to have an icon in the toolbar seeing that we use it so often. Thanks!

Posted

Depending on your setup, I doubt that you will be happy with MLINEs.

 

  • Do you fillet / trim / extend corners etc?
  • Does MLINE support multiple linetypes / layers / thicknesses
  • I don't remember seeing anyone make a mline with ( entmake )

 

-David

Posted

Thanks David. It should be perfect for our use..their just used for beams, headers, etc..all straight all on the str-txt layer..Sometimes we have to draw the foundations..this way is so much quicker!

 

Basically I saved the different linetypes I needed as a separate mnl file. Put them into a block. Used a filtering lisp to insert and delete the block into every drawing opened. In customization in the toolbars I created a new tool going something like ^C^C_mline;STYLE;SR specifying the mline or ^C^C_mline;STYLE;sr;J;TOP specifying the mline and justification for each mline we'll need..lastly i moved them into the tool pallets with an example image and text description next to it..Hope this helps someone out.

Posted

Lee/david take a look at how I came about doing this..I've looked at that post and about 20 others dealing with mlines..could the above method pose any problems?

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