replace existing linetypes

Discussion in 'AutoCAD' started by Nathan Withers, Nov 1, 2004.

  1. I am trying to replace existing linetypes in a drawing and it is more
    trouble than I care to deal with right now. Can I get a little help? Here
    is the situation, there are a number of drawings that have incorrect
    linetypes loaded and in use. I need to replace these with the correct
    linetypes. I can't get entupd to work on linetypes (I vaguely remember some
    discussions about it not working with linetypes that are in use). Does
    anyone have a way to replace existing linetypes without having to remove all
    reference to them, delete them, load the new linetypes and "remap" the
    layers and lines? I know htere isn't a way to do this with Vlisp either...
    I have checked. Classic LISP works better when dealing with linetypes.

    Thanks.
     
    Nathan Withers, Nov 1, 2004
    #1
  2. Nathan Withers

    Paul Turvill Guest

    1 - Load the new (replacement) linetype(s)
    2 - Select objects of an incorrect linetype (using the FILTER option), and
    change them to the correct one with the PROPERTIES window.
    3 - Repeat with other incorrect linetypes.
    4 - In the Layer dialog, change layers with incorrect linetypes to reflect
    correct ones.
    5 - PURGE to get rid of old (now unused) linetypes.

    BTW, I don't know how you "checked" but all of these operations are quite
    easily accomplished with VLisp. ...or a script, or ...
    ___
     
    Paul Turvill, Nov 1, 2004
    #2
  3. Yet again my familiarity with the situation leads me to under explain and
    over simplify the problem. I need to replace the incorrect linetypes with
    the correct linetypes which have EXACTLY the same name. I am not the genius
    that created custom linetypes with the same names as ACAD default linetypes.

    I agree with you, Paul, about (un)loading linetypes being simple. But I am
    trying to find a way to REPLACE linetypes that are already in use, not
    assign a different linetype.
     
    Nathan Withers, Nov 1, 2004
    #3
  4. Nathan Withers

    David Kozina Guest

    PMFJI,
    But, huh?

    Command: FILEDIA
    Enter new value for FILEDIA <1>: 0

    Command: -LINETYPE
    Current line type: "ByLayer"
    Enter an option [?/Create/Load/Set]: L

    Enter linetype(s) to load: DASHED
    Enter name of linetype file to search <acad.lin>:

    Linetype "DASHED" is already loaded. Reload it? <Y>


    What am I missing here?
     
    David Kozina, Nov 1, 2004
    #4
  5. Nathan Withers

    Paul Turvill Guest

    Then the answer is even simpler: Just reload the linetypes from the correct
    *.lin file. When asked if you want to reload, respond with Y (or Yes).
    ___
     
    Paul Turvill, Nov 1, 2004
    #5
  6. Holy crap! How has this technique escaped me for so long. I never thought
    that the command prompt would give the option to reload if the dialog box
    doesn't give the same option. When writing lisp routines I don't normally
    like using methods that involve calling the "command" function because that
    is more like scripting than programming. But since this is the only method
    I have ever seen for replacing linetypes, I will make a HUGE exception.
    Thanks, David, for teaching this old dog a new trick. Never would have
    found that one without help from the newsgroups.


     
    Nathan Withers, Nov 1, 2004
    #6
  7. Nathan Withers

    Paul Turvill Guest

    But the dialog *does* offer that option.
    ___
     
    Paul Turvill, Nov 1, 2004
    #7
  8. *after testing for myself* It does! I must be losing my mind. I swear I
    tried the dialog box and it didn't give me that option before. I guess I
    was using the Design Center at the time and assumed that it wouldn't work
    from the linetype dialog box either. My frustration with other things must
    be getting to me. Too bad, I used to consider myself a good CAD guru.
     
    Nathan Withers, Nov 1, 2004
    #8
  9. Nathan Withers

    David Kozina Guest

    Nathan,

    It just started doing that yesterday, if it'll make you feel any better...
    ;)

    I don't know if the 'Load method will automatically redefine the linetype or
    not.
    Perhaps worth a shot in order to avoid the icky command route...

    (setq AcadObject
    (vlax-get-acad-object)
    )
    (setq ActiveDocument
    (vlax-get-property AcadObject 'ActiveDocument)
    )
    (setq Linetypes
    (vlax-get-property ActiveDocument 'Linetypes)
    )
    (vlax-invoke-method
    Linetypes
    'Load
    Linetype_str
    "acad.lin"
    )
     
    David Kozina, Nov 1, 2004
    #9
  10. Or just change the 'expert' variable prior to reloading linetypes.... my
    toolbar button looks like this:
    ^C^C(setq exvar (getvar
    "EXPERT"));EXPERT;3;FILEDIA;0;-LINETYPE;LOAD;*;ACAD.LIN;;(SETVAR "EXPERT"
    EXVAR);FILEDIA;1;

    This loads / reloads all linetypes in the acad.lin file. With a quick purge
    after it's done, all is well.

    Casey
     
    Casey Roberts, Nov 2, 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.