Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Xline Lisp to draw two or more parallel xlines space with a give distance.

6 REPLIES 6
Reply
Message 1 of 7
dkeyser
1947 Views, 6 Replies

Xline Lisp to draw two or more parallel xlines space with a give distance.

I am looking for a lisp that will draw two or more parallel xlines space with a give distance.  If there is no lisp already created, can someone help me to create one?

 

Thanks

danny

Tags (3)
6 REPLIES 6
Message 2 of 7
_Tharwat
in reply to: dkeyser

Can you please provide more details about your goal of the code ?

Message 3 of 7
lgabriel
in reply to: _Tharwat

Simple program to start with. Creates Horizontal Xlines based upon start point, number and spacing

 

;Degrees to Radians
(defun dgtrad(a)
    (* a (/ PI 180.0))
)
;Point Offset
(defun newpt (a b c d e / x)
    (setq x (polar a (dgtrad c) b))
    (setq x (polar x (dgtrad e) d))
    (setq x x)
)
;
(defun c:autoxl()
   (echooff)
   (setq no (getint "\Enter number of xlines: "))
   (setq spacing (getreal "\nEnter desired spacing: "))
   (setq pt (getpoint "\nSelect desired point: "))
   (repeat no
      (command "XLINE" "H" pt "")
      (setq pt (newpt pt spacing 90 0 0))
   )
)

 

If this is what you are looking for, I can expand program for Horizontal, Vertical, or Angled

 

Message 4 of 7
dkeyser
in reply to: _Tharwat

I would like the lisp to work like the Mline command, but instead of it drawing Mline it draws xlines.

 

What I am trying to do is cut down the number of commands and clicks I have to do to create an elevation from a floor plan and wall section.  

 

Right now I draw a vert. or horz. Xline at both corners of each window mullion and exit the command. Then, I use the copy command to select both xlines and proceed to past them at other window mullion locations.

 

Since I already know my mullion width, I would like to be able to do the xline command and do the following prompts:

 

  • Select horz., vert. or angle
  • Select the number of lines
  • Enter a value or values for the line spacing
  • Choose where I want the justification to be (left, right or center)

See attachment

Message 5 of 7
Kent1Cooper
in reply to: dkeyser


@dkeyser wrote:

I am looking for a lisp that will draw two or more parallel xlines space with a give distance.  If there is no lisp already created, can someone help me to create one?....


As a "raw" answer to this, not expanded into the multiple-mullion needs of your latest post, try the attached MultiXLine.lsp with its MXL command.

 

And for something very similar to your latest description [except that it divides the overall area equally], try PanelDivRect.lsp at the end of this thread:

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Simple-problems-with-my-divide-panels...

Kent Cooper, AIA
Message 6 of 7
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:

@dkeyser wrote:

I am looking for a lisp that will draw two or more parallel xlines space with a give distance.  ....


As a "raw" answer to this, ... try the attached MultiXLine.lsp with its MXL command.

....


Enhanced version:  I figured out how to make it DYNAMIC -- it shows you what you're going to get as you move the cursor around at the through-point prompt.

 

It doesn't have some of the other Xline options yet, but I'll keep working on it [I want to add Hor/Ver/Ang, but don't picture Bisect/Offset being useful for multi-Xlines].  I have a notion that it might even be possible to allow for defined Styles similar to what you can do in Mline.  And I'm looking into getting it to honor Osnaps on the second point [there are threads about (grread) vs. Osnap that I need to plow through].

Kent Cooper, AIA
Message 7 of 7
dkeyser
in reply to: Kent1Cooper

Thanks Kent, do you think it is possibly to have it setup where you can paste 2 lines at once and do it multiple times without having to reenter the command?  Example would be how xline command works now. 

 

danny

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost