Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: create linetype

  1. #1
    Member
    Join Date
    2004-03
    Location
    Jacksonville, FL
    Posts
    23
    Login to Give a bone
    0

    Default create linetype

    I'm trying to create a new linetype as part of a vba program i'm writing but all of the commands I see will only LOAD a linetype. Even the add command only adds an already existing linetype to the collection. So, aside from using the 'Send Command' function, can I create a totally new linetype directly from VB? I don't need it to be horribly complex, just a dash, couple of letters and another dash.
    Thx!

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: create linetype

    This is sort of related to your question about shapes. Shape and linetype files are ascii files that are really a whole other language. They work similar to plotter definition languages where you describe simple vectors to plot. Pick the pen up, move to point A, put the pen down and move it to point B. Really basic stuff. Neither vba nor lisp has any direct translation to linetype or shape. You can examine mkltype.lsp and mkshape.lsp to see how others did it and then plan out a route for vba.
    C:> ED WORKING....


    LinkedIn

  3. #3
    100 Club mtuersley's Avatar
    Join Date
    2001-12
    Posts
    122
    Login to Give a bone
    0

    Default Re: create linetype

    Now the question about shapes makes sense because you're looking to make linetypes. A better question is what are you trying to accomplish? After 20 years of consulting and doing this, I can count on both hands the number of linetypes that I've needed to create - they're finite not infinite. Plus have you considered the ramifications that anyone accessing the drawing will need all of those linetype defs as well?

  4. #4
    Member
    Join Date
    2004-03
    Location
    Jacksonville, FL
    Posts
    23
    Login to Give a bone
    0

    Default Re: create linetype

    You're right, it is all related. They're all questions about different parts of the same program.
    I figured this out though...there's not really any way to do this with VBA for AutoCAD because there's no way to do this in AutoCAD. {This is the point where I'm shaking my fist and screaming}
    Theoretically, I could create a simple linetype with VB thru AutoCAD, then have VB open the notepad file and add in the text or shape I want but the logistics and possible side effects of this are enough to make me cry. {Imagine if I don't specify the proper notepad file and accidentally edit my system registry and, yes, I know that's a rather dramatic example}
    So, until an upgrade, I'm resigned to call the express tool anyway. One day when I'm feeling suicidal I'll probably try to rewrite the mkshape and mkltype commands in VBA.

  5. #5
    Member
    Join Date
    2004-03
    Location
    Jacksonville, FL
    Posts
    23
    Login to Give a bone
    0

    Default Re: create linetype

    The plan of the whole program is this:
    1. Create custom linetype based on lettering provided by the user
    - the purpose of the shape file is to 'lock' the lettering file so that changes to a text style don't mess it up, although we've now decided to just use text to give us greater flexibility
    2. Apply this new linetype to a specified layer
    - Right now I'm applying it to the active layer but I want to add a list box later
    3. Explode all plines on the layer
    4. (The really useful part) Check the angle of every line on this layer to determine if the text is facing the correct way and rotate the line 180 degrees from the center-point if it's not.

    What I'm having trouble with isn't making a program that works, it's making it so that the only user input is the lettering and the layer. The way it is now (and has to be, i guess), I have to trust the user to select the correct file for the linetypes and I really don't like that. I prefer to make the program so that it can be run by an average cabbage (just in case) but I'm accepting that it just won't be possible in this case.
    The option I'm leaning towards is copying the filepath & name to the windows clipboard just before sending the mkltype command and putting text across the screen that tells the user to press Ctrl+v and click save. That way the user doesn't have to remember the filepath but they can still enter it properly each time. That also allows me to direct them towards a different file if I need to without ever telling them about it.

  6. #6
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: create linetype

    You listed the tasks you want your program to perform. I think what Mike was asking for was more along the lines of the goals of your program. IOW, what's the purpose of your program? Maybe you're going about it the hard way? If you outline what you want, we may be able to provide some more workable suggestions.
    C:> ED WORKING....


    LinkedIn

  7. #7
    Member
    Join Date
    2004-03
    Location
    Jacksonville, FL
    Posts
    23
    Login to Give a bone
    0

    Default Re: create linetype

    True. In the end, I need a lettered linetype applied to a layer (like --CHWS--) and to have all of the lettering in-line with the line and facing either down or right.
    I'm not too concerned about packaging an extra linetype with the drawing since we're already packaging a bunch of xrefs with each one anyway.

  8. #8
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: create linetype

    Perhaps then, create a standard lintype file with all your linetypes in it. Then your vba only hast to assign a linetype to the layer, which could also be standard in a template.
    C:> ED WORKING....


    LinkedIn

  9. #9
    Member
    Join Date
    2004-03
    Location
    Jacksonville, FL
    Posts
    23
    Login to Give a bone
    0

    Default Re: create linetype

    This would probably work, I know what most of the linetypes will be. The only reason I hadn't done it this way was that the request was to be able to enter the lettering on the fly.
    The thought had crossed my mind to just create all possible linetypes ahead of time but that would be 475254 linetypes...

  10. #10
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: create linetype

    I think you need to back up a step farther and explain the whole process, i.e. what requires that many linetypes. Maybe you shouldn't even be using linetypes to accomplish what your goals??
    C:> ED WORKING....


    LinkedIn

Page 1 of 2 12 LastLast

Similar Threads

  1. 2014: Create a custom linetype with two colors
    By boyerd492098 in forum AutoCAD General
    Replies: 2
    Last Post: 2015-05-23, 10:22 PM
  2. Create new linetype with inserted text
    By Tavi LASCU in forum AutoCAD LT - General
    Replies: 3
    Last Post: 2008-03-21, 01:36 PM
  3. I'm trying to create a linetype that has 8" in the linetype
    By mikeprentiss in forum AutoCAD Customization
    Replies: 11
    Last Post: 2006-08-17, 12:11 PM
  4. Create a custom linetype with an Arc in it
    By tyeelaw13 in forum AutoCAD Customization
    Replies: 5
    Last Post: 2006-07-14, 03:49 PM
  5. Create a custom bold dot linetype
    By nanoaguilar2000 in forum AutoCAD Customization
    Replies: 3
    Last Post: 2004-09-28, 06:19 PM

Posting Permissions

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