Points & Leaders

Discussion in 'AutoCAD' started by gerbil, Jun 8, 2004.

  1. gerbil

    gerbil Guest

    Addmitedly I'm not the greatest VBA programmer so would appriciate some direction...please:-
    I need to input a number of points from a text file into a drawing by x, y, z coords. no problem I've done this. However I also need to attached a 'name' with each point which will also be taken from the text file.
    Utimately I want to be able to create a leader by selecting one of the points and the contents of the leader would be the attached 'name'.
    Which direction should I go in?
    Thanks in anticipation :mad:}
     
    gerbil, Jun 8, 2004
    #1
  2. gerbil

    wivory Guest

    Hmmm...interesting requirement. If it was me I'd use a Scripting Dictionary (not Acad Dictionary). Traditionally you'd have the name as the key and the coordinates as the value, but in your case you want to lookup on the selected coordinates so you'd need to store the coordinates as the key and the name as the value.

    I'm not sure whether the Dictionary will let you have a 3-element variant as a key but you might as well try it. If it doesn't work you can simply have the coordinates as a comma-separated string like they are in the text file.

    One possible 'gotcha': if you had more than one entry with the same coordinates.

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Jun 9, 2004
    #2
  3. gerbil

    gerbil Guest

    Thanks Wayne,

    That may be a little complicated for me, so I've started going down the SETXDATA and GETXDATA route. I'm thinking if when my program creates the points by extracting x, y, z from the text file it will also use SETXDATA and attached the name from the textfile for each point to the point drawn.
    I then will be able to write a program to create a leader by selecting one of the points and the contents of the leader will be the XDATA (which will be assigned to each point).
    Am I totally barking up the wrong tree and should I turn back now, or do you think I may have a hope in hell of making this work.

    Thanks for any advise,

    Matt
     
    gerbil, Jun 9, 2004
    #3
  4. gerbil

    wivory Guest

    Actually that sounds like a perfectly valid alternative.

    Regards

    Wayne
     
    wivory, Jun 10, 2004
    #4
  5. gerbil

    gerbil Guest

    Thanks,
    atleast I'm heading in the right direction.
    Still having real problems working out how to create a leader and getting the mtext to equal the xdata.
    I've attached the xdata without any problem but seeing it isn't as easy.
    Any suggests or code to get me going would be appreciated.

    Cheers

    Matt

    Alcoa UK
     
    gerbil, Jun 10, 2004
    #5
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.