• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Contributor
    Posts: 16
    Registered: ‎01-05-2006

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

    261 Views, 6 Replies
    07-12-2012 07:10 AM

    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

    Please use plain text.
    Valued Mentor
    _Tharwat
    Posts: 459
    Registered: ‎07-02-2010

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

    07-12-2012 08:01 AM in reply to: dkeyser

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

    Please use plain text.
    Valued Contributor
    Posts: 100
    Registered: ‎05-01-2003

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

    07-12-2012 08:55 AM 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

     

    Please use plain text.
    Contributor
    Posts: 16
    Registered: ‎01-05-2006

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

    07-12-2012 09:15 AM 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

    Please use plain text.
    *Expert Elite*
    Kent1Cooper
    Posts: 4,058
    Registered: ‎09-13-2004

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

    07-12-2012 09:55 AM 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
    Please use plain text.
    *Expert Elite*
    Kent1Cooper
    Posts: 4,058
    Registered: ‎09-13-2004

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

    07-17-2012 08:37 AM 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
    Please use plain text.
    Contributor
    Posts: 16
    Registered: ‎01-05-2006

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

    07-19-2012 05:41 AM 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

    Please use plain text.