Jump to content

Convert Polylines into lines???


ramis

Recommended Posts

Guest Alan Cullen

ramis...

 

Dave just snuck in before me......but I echo what he said.....there is nothing wrong with your English.......when you look at the diversity of members (which I absolutely aknowledge you are one) you will see there really is no problem with language......take Zars for e.g. You would never believe he can't speak English......(sorry, mate)

 

Just join in and become a global member.....:lol:

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • ramis

    10

  • dbroada

    4

  • Norts

    2

  • SEANT

    1

Top Posters In This Topic

thank you dave:oops:

concerning your French, don't worry... an AutoCAD expert like you... i'm sure that your French is perfect!!! i just hope that you will enjoy your trip in this marvellous country:D

Link to comment
Share on other sites

  • 1 year later...
I think I am missing something. I cannot actually see anything unexpected there. If you keep exploding a polyline it will eventually resolve into lines and arcs. These are the two base drawing components.

 

Take a peek-a-boo at the attached *.dwg file.

Might there be an easy way to convert this segmented circle into a solid circle?

 

This segmented circle, and sometimes lines, was generated when I used pdf2cad to convert the *.pdf file to a *.dxf. The *.dxf saved to a *.dwg.

 

More often than not, I delete the segmented "stuff" and redraw as required.

Fragmented_Circle.dwg

Link to comment
Share on other sites

I think ASMI made this one:

 

(defun c:CurvesToSegments(/ cSet sLen cLen sDis ptLst oOsn
             eLst cAns vCnt lPt)
 
 (vl-load-com)

 (princ "<<< Select curves to transform >>>")
 (if
   (setq cSet
      (ssget
         '((0 . "*POLYLINE,SPLINE,ARC,CIRCLE,ELLIPSE"))))
   (if(setq sLen(getdist "\nSpecify segment lentgth: "))
     (progn
   (setq oOsn(getvar "OSMODE"))
   (setvar "CMDECHO" 0)(setvar "OSMODE" 0)
       (foreach itm(setq eLst(vl-remove-if 'listp
                       (mapcar 'cadr(ssnamex cSet))))
   (setq sDis 0.0
         cLen(-(vlax-curve-getDistAtParam itm
             (vlax-curve-getEndParam itm))
           (vlax-curve-getDistAtParam itm
             (vlax-curve-getStartParam itm)))
           ); end setq
   (if(= "LWPOLYLINE"(cdr(assoc 0(entget itm))))
   (progn
     (setq vCnt 1
       ptLst(list(vlax-curve-GetPointAtDist itm sDis)))
      (while(and
          (<= sDis cLen)
          (vlax-curve-GetPointAtParam itm vCnt)
          (setq cPt(vlax-curve-GetPointAtDist itm sDis))
          ); end and
         (if(= 0.0(vla-GetBulge(vlax-ename->vla-object itm)(1- vCnt)))
       (setq ptLst(append ptLst
                 (list(vlax-curve-GetPointAtParam itm vCnt)))
             sDis(vlax-curve-GetDistAtParam itm vCnt)
             ); end setq
       (progn
         (while(<= sDis(vlax-curve-GetDistAtParam itm vCnt))
           (setq cPt(vlax-curve-GetPointAtDist itm sDis)
             ptLst(append ptLst(list cPt))
             sDis(+ sDis sLen))
           ); end while
         (setq ptLst(append ptLst
                 (list(vlax-curve-GetPointAtParam itm vCnt))))
         ); end progn
       ); end if
         (setq vCnt(1+ vCnt))
        ); end while
     ); end progn
      (while(and
          (<= sDis cLen)
          (setq cPt(vlax-curve-GetPointAtDist itm sDis))
          ); end and
        (setq ptLst(append ptLst(list cPt))
          sDis(+ sDis sLen))
      ); end while
     ); end if
     (if(not(equal(setq lPt(vlax-curve-getEndPoint itm))(last ptLst)))
       (setq ptLst(append ptLst(list lPt)))
      ); end if
   (command "_.pline")(mapcar 'command ptLst)(command "")
   (setq ptLst nil)
      ); end foreach
   (initget "Yes No")
   (setq cAns(getkword "\nRemove old curves [Yes/No] <Yes>: "))
   (if(or(null cAns)(= cAns "Yes"))
     (mapcar 'entdel eLst)
     ); end foreach
      (setvar "CMDECHO" 1)(setvar "OSMODE" oOsn)
     ); end progn
    ); end if
   ); end if
 (princ)
 ); end of c:CurvesToSegments

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...