join routine

Discussion in 'AutoCAD' started by shaw.n, Nov 4, 2004.

  1. shaw.n

    shaw.n Guest

    can anyone help me with a routine?
    i have a logo in the form of a name i.e BURBERRY.
    it is in separate lines and i need to join them all as individual polylines as in pedit join.

    is there a routine where i can select all and they all join to themselves in one go?
    what i mean by separate lines is for example, the B is in 22 lines, the U is in 10 lines etc.

    help app..

    n.s.
     
    shaw.n, Nov 4, 2004
    #1
  2. The pedit command wil do this, select one lineto turn into A Poly, and
    select the rest with the Jin command. Provided the endpoints meet, you
    should be sweet.

    Greg
     
    Greg McLandsborough, Nov 5, 2004
    #2
  3. shaw.n

    shaw.n Guest

    i appreciate that the pedit command will do this. however, i will have to do every letter to my logo independently. i have lots of different logos to do and this i fear would take me a while. what i am looking for is a routine that will select all lines / polylines in one instance, and join them to each other at once. in other words when i have issued the routine, all of the lettering will be joined as separate entities as single letters.

    n.s.
     
    shaw.n, Nov 5, 2004
    #3
  4. Ok, are all the lines polylines? Arc will be a small problem. But basically
    you want a routine to select polylines and join them if there end points are
    the same.

    Can you send a sample drawing?


    do every letter to my logo independently. i have lots of different logos to
    do and this i fear would take me a while. what i am looking for is a
    routine that will select all lines / polylines in one instance, and join
    them to each other at once. in other words when i have issued the routine,
    all of the lettering will be joined as separate entities as single letters.
     
    Greg McLandsborough, Nov 5, 2004
    #4
  5. Would Boundary work for you? You'd have to pick inside each letter, and I
    guess each interior "hole" outline, then erase the lines/arcs, but it might
    still be quicker than using a bunch of Pedit's.
     
    Kent Cooper, AIA, Nov 5, 2004
    #5
  6. shaw.n

    Douglas Barr Guest

    If the boundary command works (i.e. if the area is fully enclosed), then he can use
    the 'select entities' option instead of the 'pick point within area' option. Right?
     
    Douglas Barr, Nov 5, 2004
    #6
  7. shaw.n

    Joe Burke Guest

    Using 2004 here.

    I think you're missing the pedit multiple option.

    Given your example drawing:

    Command: pedit
    Select polyline or [Multiple]: m
    Select objects: Specify opposite corner: 853 found ;; select all objects in "make
    this one"
    Select objects:
    Convert Lines and Arcs to polylines [Yes/No]? <Y>
    Enter an option [Close/Open/Join/Width/Fit/Spline/Decurve/Ltype gen/Undo]: j
    Join Type = Extend
    Enter fuzz distance or [Jointype] <0.0000>:
    1231 segments added to 60 polylines

    The result is the same as your "like this one" example. IOW, code not needed in this
    case.

    Joe Burke
     
    Joe Burke, Nov 5, 2004
    #7
  8. I just tried drawing a few closed line outlines (in both 2000 & 2004), and
    then tried Boundary. Pick Points is the only choice you get. (Help says
    the Boundary dialog box is just a limited version of the Bhatch dialog box,
    and apparently the other functions are only used in Bhatch.)

    But I did find that with outlines inside other outlines (like the holes in a
    B, for instance), one Boundary command makes all the polylines you need --
    you don't have to pick inside the holes, too.

    ALSO, it occurs to me to wonder exactly what shaw.n wants to do with the end
    result. If it doesn't need to have thickness applied, or be offset, or
    something else that requires them to be polylines, then there are other
    available ways to consolidate the elements together, like Block or Group, or
    maybe even Region.
     
    Kent Cooper, AIA, Nov 5, 2004
    #8
  9. shaw.n

    Douglas Barr Guest

    I spoke before testing! I've used bhatch, which does offer selection of entities.
     
    Douglas Barr, Nov 5, 2004
    #9
  10. Code:
    ; #PlineJoinPrec = global
    ;
    (defun C:ALE_PlJoin (/ SelSet FltLst OldLPr)
    ;(setvar "CMDECHO" 0) ; I have always = 0
    (princ "\nSelect lines, arcs or polylines to join:  ")
    (setq OldLPr (getvar "LUPREC"))  (setvar "LUPREC" 8)
    (setq
    FltLst
    '((0 . "LWPOLYLINE,POLYLINE,LINE,ARC"))
    #PlineJoinPrec
    (ureal 5 "" "Precision distance" (cond ( #PlineJoinPrec ) ( 0.00001 )))
    )
    (setvar "LUPREC" OldLPr)
    (cond
    ( (not (setq SelSet (cond ((ssget "_I" FltLst)) ((ssget FltLst)))))
    (prompt "\nNo arc or polyline selected.  ")
    )
    ( (ssget "_P" '((0 . "LINE,ARC")))
    (command "_.PEDIT" "_M" SelSet "" "_Y" "_J" "_J" "_E" #PlineJoinPrec
    "")
    (princ (strcat
    "\n" (itoa (sslength SelSet))
    " lines, arcs or polylines are joined.  "
    )       )
    )
    ( T
    (command "_.PEDIT" "_M" SelSet "" "_J" "_J" "_E" #PlineJoinPrec "")
    (princ "\n_ ")
    (princ (strcat "\n " (itoa (sslength SelSet)) " polylines are joined.
    "))
    )
    )
    (princ)
    )
    ;*
    ;* UREAL  Funzione di interfaccia utente per numeri reali.
    ;* BIT (0 per nessuno) e KWD key word ("" per nessuna) sono gli stessi di
    ;* INITGET.
    ;* MSG e' la stringa di prompt, alla quale e' aggiunto numero reale di
    default
    ;* come <DEF> (nil per nessuno), e un : sara' aggiunto.
    ;*
    (defun ureal (bit kwd msg def / inp)
    (if def
    (setq
    msg (strcat "\n" msg " <" (ALE_RTOS_DZ8 def) ">: ")
    bit (* 2 (fix (/ bit 2)))
    )
    (setq msg (strcat "\n" msg ": "))
    )
    (initget bit kwd)
    (setq inp (getreal msg))
    (if inp inp def)
    );defun UREAL
    ;
    (defun ALE_RtoS_DZ8 (ReaVal / CurDZn OutVal)
    (if (= 8 (setq CurDZn (getvar "DIMZIN")))
    (setq CurDZn nil)
    (setvar "DIMZIN" 8)
    )
    (setq OutVal (rtos ReaVal 2))
    (and CurDZn (setvar "DIMZIN" CurDZn))
    OutVal
    )
    


    --

    Marc'Antonio Alessi
    http://xoomer.virgilio.it/alessi
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    --
     
    Marc'Antonio Alessi, Nov 5, 2004
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.