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,713
    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 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  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,713
    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 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

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
  •