See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Generate 2d Polylines from Alignments

  1. #1
    Member
    Join Date
    2013-07
    Posts
    10
    Login to Give a bone
    0

    Default Generate 2d Polylines from Alignments

    Does anyone know of a .lsp out there that will allow me to select multiple alignments and generate polylines from them?

    I am currently using 'offset' to offset the alignment as a pline and then offset that pline back on top of the alignment....but I can only do one alignment at a time.

    And I dont want to make copies of my alignments and explode them.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,599
    Login to Give a bone
    2

    Default Re: Generate 2d Polylines from Alignments

    Code:
    (vl-load-com)
    
    (defun c:GetAlgnPlines (/ *error* acDoc clayer ss)
    
      (defun *error* (msg)
        (if ss (vla-delete ss))
        (if acDoc (vla-endundomark acDoc))
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )  
    
      (if (ssget "_:L" '((0 . "AECC_ALIGNMENT")))
        (progn
          (vla-startundomark
            (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
          )
          (setq clayer (getvar 'clayer))
          (vlax-for	x (setq ss (vla-get-activeselectionset acDoc))
    	(vla-put-layer (vlax-invoke x 'getlwpolyline) clayer)
          )
        )
      )
    
      (*error* nil)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3630, Core i9-9900K 5.0GHz, 128GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  3. #3
    Member
    Join Date
    2013-07
    Posts
    10
    Login to Give a bone
    0

    Default Re: Generate 2d Polylines from Alignments

    @BlackBox

    Where have you been all my life?
    Thanks!

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,599
    Login to Give a bone
    0

    Default Re: Generate 2d Polylines from Alignments

    Quote Originally Posted by kylehalchin View Post
    @BlackBox

    Where have you been all my life?
    Thanks!
    I've been around.

    Happy to help.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3630, Core i9-9900K 5.0GHz, 128GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

Similar Threads

  1. Polylines with arcs to polylines with segments
    By randyspear in forum AutoCAD General
    Replies: 1
    Last Post: 2009-04-15, 06:22 PM
  2. Replies: 7
    Last Post: 2008-02-22, 04:13 PM
  3. How to change LW PolyLines to 2D PolyLines
    By Lions60 in forum AutoLISP
    Replies: 10
    Last Post: 2007-07-13, 05:58 PM
  4. How to convert 3D Polylines to 2D Polylines
    By GreyHippo in forum AutoLISP
    Replies: 16
    Last Post: 2007-01-04, 05:32 PM
  5. AutoCAD polylines to 3d polylines
    By neil_morrish in forum AutoCAD General
    Replies: 5
    Last Post: 2004-07-22, 10:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •