+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
  1. #1
    Super Member
    Using
    AutoCAD 2008
    Join Date
    Jul 2007
    Posts
    536

    Default Script to change certain linetypes to another?

    Registered forum members do not see this ad.

    Would it be possible to create some kind of script to search through all layers in a DWG and change for example all 'Center' linetypes to 'Center2', and all 'Dashed' to 'Dashed2' etc?

    Also could it be cleverer and search within a linetypes name so it could pick up these linetypes is they're from an XREF & beginning with eg 'XREF1Center' and changing it to 'Center'

    Also, anyone fancy writing a script for this?

    Currently we don't have any decent standards in our company, I'm in no position to create any so am trying to find a quick fix rather than changing everything manually to make linetypes display correctly.
    Using AutoCAD2012, Civil 3D 2012, 3DS Max 2012, AutoCAD MEP 2011, Imagemodeler 2009, Zbrush, Solidworks, PTGui, Photomatix, Photoshop

    PORTFOLIO: http://www.flickr.com/photos/47676682@N04/

  2. #2
    Forum Deity NBC's Avatar
    Using
    AutoCAD 2009
    Join Date
    Aug 2007
    Location
    Manchester, UK
    Posts
    2,109

    Default

    1. "All linetypes of entities should be set to be BYLAYER." That should be the first line in your standard on linetypes.
    Life's constantly changing - keep up or get left behind

  3. #3
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    Quote Originally Posted by spittle View Post
    Would it be possible to create some kind of script to search through all layers in a DWG and change for example all 'Center' linetypes to 'Center2', and all 'Dashed' to 'Dashed2' etc?

    Also could it be cleverer and search within a linetypes name so it could pick up these linetypes is they're from an XREF & beginning with eg 'XREF1Center' and changing it to 'Center'

    Also, anyone fancy writing a script for this?

    Currently we don't have any decent standards in our company, I'm in no position to create any so am trying to find a quick fix rather than changing everything manually to make linetypes display correctly.
    Quick answer, Yes.
    I can put something together in VBA if you want, with a Form and 2 drop-down lists to select. It will only list the linetypes that are already loaded though.

  4. #4
    Super Member
    Using
    AutoCAD 2008
    Join Date
    Jul 2007
    Posts
    536

    Default

    LCE - Yeah that would be great!

    NBC - Yes you're right, Currently I'm receiving drawings from contractors, surveyors, colleauges. Some are good, some are crap! Some drawings contain a mixture of imperial & metric linetypes, some a scaled by overiding the entity in properties. Also some of my superiors may find it a bit arrogant of me to try and start telling them how they should be doing their drawings as I was only promoted from a junior last month, even though some of their drawings really suck!

    I want to be able to quickly, set all linetypes to by layer, and linetype scale 1, and then change all of them to use the default linetypes which end with number 2. This is because the linetypes that don't end with 2, eg 'center' look far too big when used with linetypes containing text.
    Luckily, both the imperial & metric .lin files contain identical linetype names so the relevant one can be loaded easily and if linetypes are included in a drawing that arn't written in both the metric & imoperial .lin files, then I can just load the other .lin file and change the Global Linetype Scale.

    Hope that makes sense!
    Using AutoCAD2012, Civil 3D 2012, 3DS Max 2012, AutoCAD MEP 2011, Imagemodeler 2009, Zbrush, Solidworks, PTGui, Photomatix, Photoshop

    PORTFOLIO: http://www.flickr.com/photos/47676682@N04/

  5. #5
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    See attached.
    Let me know if you need any help with this.
    Last edited by LCE; 28th May 2008 at 05:09 pm.

  6. #6
    Super Member
    Using
    AutoCAD 2008
    Join Date
    Jul 2007
    Posts
    536

    Default

    Hello mate, how do I load that? I had someone have go who's had some experience with writing VBA but no luck so far.

    Cheers

    Dave
    Using AutoCAD2012, Civil 3D 2012, 3DS Max 2012, AutoCAD MEP 2011, Imagemodeler 2009, Zbrush, Solidworks, PTGui, Photomatix, Photoshop

    PORTFOLIO: http://www.flickr.com/photos/47676682@N04/

  7. #7
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    Just made 1 little change.
    To load it type -vbarun at the command line and then

    "filepath\ltset.dvb!Start"

    Where filepath is the location of the ltset.dvb

    Let me know if you need any more help with this.
    Last edited by LCE; 28th May 2008 at 05:09 pm.

  8. #8
    Super Member
    Using
    AutoCAD 2008
    Join Date
    Jul 2007
    Posts
    536

    Default

    Hi

    I've got this working but in the existing lt dropdown it contains all the linetypes from the .lin file that the drawing is using, even though I've purged out all the linetypes not needed. This would involve changing a silly number of linetypes when it's not needed.

    Thanks for trying though

    Dave

    *EDIT*

    I think these linetypes are being loaded from my XREFs, also is there a way to change the second dropdown to display only the linetypes in my .lin file, rather than having all the ones nested in the XREFs as well?
    Using AutoCAD2012, Civil 3D 2012, 3DS Max 2012, AutoCAD MEP 2011, Imagemodeler 2009, Zbrush, Solidworks, PTGui, Photomatix, Photoshop

    PORTFOLIO: http://www.flickr.com/photos/47676682@N04/

  9. #9
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    Quote Originally Posted by spittle View Post
    Hi

    I've got this working but in the existing lt dropdown it contains all the linetypes from the .lin file that the drawing is using, even though I've purged out all the linetypes not needed. This would involve changing a silly number of linetypes when it's not needed.

    Thanks for trying though

    Dave

    *EDIT*

    I think these linetypes are being loaded from my XREFs, also is there a way to change the second dropdown to display only the linetypes in my .lin file, rather than having all the ones nested in the XREFs as well?
    Yes, should be simple enough. I will try and have a look this afternoon.

  10. #10
    Super Member
    Using
    AutoCAD 2008
    Join Date
    Jul 2007
    Posts
    536

    Default

    Registered forum members do not see this ad.

    Great, thanks, don't suppose there's any way to do a search within VBA? So any linetype containing 'center' could be picked up automatically?

    Eg "XREF12314144linetypecenter"

    No sweat if it's not possible!
    Using AutoCAD2012, Civil 3D 2012, 3DS Max 2012, AutoCAD MEP 2011, Imagemodeler 2009, Zbrush, Solidworks, PTGui, Photomatix, Photoshop

    PORTFOLIO: http://www.flickr.com/photos/47676682@N04/

Similar Threads

  1. When I change the color the dimensions change!
    By Mark Costantino in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 12th Oct 2009, 05:55 pm
  2. Can I use a script to change text on 100 drawings?
    By Ste1978 in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 30th Oct 2007, 06:05 pm
  3. Sub script and Super script Text
    By edwin in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 1st Aug 2007, 08:07 pm
  4. Change layers on command line (writing a script)
    By big_al_from_wigan in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 7th Mar 2007, 02:12 pm
  5. Why do my linetypes change randomly?
    By rusty in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 1st Dec 2006, 02:49 pm

Bookmarks

Posting Permissions

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