Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

construction line horizontal and vertical

ami
Contributor
Contributor

construction line horizontal and vertical

ami
Contributor
Contributor

Hi everyone,

 

Could anyone help me with a very simple lisp?!

 

All I want is a lisp that creates a vertical Xline, another lisp that creates horizontal Xline (with one click only). and another lisp that creates an Xline in a specific distance that the user supplied.

 

Thanks in advance,

Ami

0 Likes
Reply
Accepted solutions (1)
2,199 Views
7 Replies
Replies (7)

injineri
Advocate
Advocate

ConstructionLines is nice add in for Autocad you can try

0 Likes

ami
Contributor
Contributor

Hi, 

 

Actually, I know this tool, and that's exactly what I wanted, because I started to work with Autocad 2019, and this tool is for 2018 down.

 

and meanwhile, until the update will release for this tool. I need the horizontal and vertical lisps, and also a lisp that makes a line in a specific distance,

 

Thanks in advance.

 

Ami.

0 Likes

Anonymous
Not applicable
Accepted solution

Sorry for any grammatical error, I'm using google to translate.

 

Try this:

 

(defun C:XLHT ()
    (while
	(setq p1 (getpoint "\nClick: "))
	(command "_.Xline" "A" "90" p1 "")
	(command "_.Xline" "A" "0" p1 "")
      )
  (princ)
)

 

Júnior Nogueira.

Por favor,  Aceitar como Solução se meu post te ajudar.

Please Accept as Solution if my post helps you.

 

0 Likes

ami
Contributor
Contributor

Thank you,

 

I believe I can use this until I get the update for "construction line tool"

 

Ami

0 Likes

Kent1Cooper
Consultant
Consultant

@ami wrote:

.... 

All I want is a lisp that creates a vertical Xline, another lisp that creates horizontal Xline (with one click only). and another lisp that creates an Xline in a specific distance that the user supplied.

....


I need some clarification.  The accepted-Solution routine does both  vertical and horizontal Xlines through the same points as you pick them, but the description above sounds like you want separate ones for vertical and horizontal, which should be something more like this:

 

(defun C:XV (/ pt)
  (while
    (setq pt (getpoint "\nPoint through which to draw Vertical Xline: "))
    (command "_.Xline" "_ver" "_none" pt "")
  )
  (princ)
)

(defun C:XH (/ pt)
  (while
    (setq pt (getpoint "\nPoint through which to draw Horizontal Xline: "))
    (command "_.Xline" "_hor" "_none" pt "")
  )
  (princ)
)

 

And I don't understand what you mean by "an Xline in a specific distance that the user supplied" -- can you post an image to illustrate?

 

You may find ConstLines.lsp with its RX command useful -- available >>here<<.  It's a combined Ray and Xline  command in which, within one  running of the command, you can switch between Xlines and Rays, between Horizontal and Vertical and Free-direction Xlines or between any of the compass directions and Free-direction Rays, as long as you want to keep going.  It puts them on a dedicated non-plotting Layer, and when you're done, returns you to the Layer you were on before.  See additional comments at that page and in the file.

Kent Cooper, AIA
0 Likes

Anonymous
Not applicable

Thank you very much. It worked for me and helped me save the extra burden.

0 Likes

thabisoT8RBP
Community Visitor
Community Visitor

Hi Kent,

 

Is there a way to add this command to my right click menu?

 

I've tried using the CUI but can't seem to find the command.

 

Kind regards,

 

Vincent Hudson

0 Likes