Show a dialog to retrieve and store additional information for a new drawing (programming)

Discussion in 'AutoCAD' started by eywitteveen, Jan 29, 2007.

  1. eywitteveen

    eywitteveen Guest

    Hello,

    I want to store information in the drawing(read dwg-file), which
    contains information like the street, the house number and city. This
    information has to be asked by a dialog, when a new drawing is
    created. (autocad 2005)

    This information can then be used by the website to show the drawing
    for a certain address. (some batch job has to process the dwg-files
    and retrieve the information and store it with the file location in
    some database)

    What would be the best way to ask the users for such information? It
    would be nice to create a dialog with some dropdown's which contain
    the streets (i did some experiments with blocks and attributes, but
    I'm not satisfied with the result)

    I have some programming skills, but i don't have a lot of autocad
    experience.

    When i posted this in the wrong group, please let me know.

    Eduard Witteveen
     
    eywitteveen, Jan 29, 2007
    #1
  2. eywitteveen

    strawberry Guest

    This question is potentially so big it's difficult to provide a
    succinct answer. Also my knowledge of how to effect such a solution is
    somewhat limited, so I'll restrict my answer to telling you what we
    do.

    Whenever we have a new project, we fill out a php form which sends
    information to a mysql database. This info includes things like the
    project name, project number, postcode, briefing date, client contact,
    etc. Pressing 'Submit' on the form also does something else rather
    clever. It effectively creates a new project folder within in the
    "projects" folder, labeled with the name and number of the project. It
    also creates a bunch of files within these folders that are also
    numbered in this way (This is, in a sense, a redundancy but it makes
    it much easier to find your drawing or whatever from lists like
    'recently opened' or whatever).

    We then use diesel routines within autocad to populate titleblocks. We
    also use layouts, so the diesel routine often combines elements of the
    layout name with elements from either the filename or filepath. We
    don't, at present, use the information contained within the database
    in our drawings but it's a good idea, and must be possible using
    autocad database connectivity. Instead, we just have web pages showing
    all the projects and contacts. Clicking on an address brings up a map
    or address labels. There's another form that populates a letter with
    project and contact info prior to opening it in Word for further
    editing. Anyway, the point I'm trying to make is this - start with the
    database, let it populate the drawing with this info, and not the
    other way round.
     
    strawberry, Jan 31, 2007
    #2
  3. eywitteveen

    eywitteveen Guest

    If now did it the otherway around, by using a menu(^C^C_attdia;1;-
    vbaload;c:/projectname/SaveAddress.dvb;-vbarun;SaveAddress;). When
    this button is pressed, a vba dialog is shown, with embedded in it a
    webbrowser control(Microsoft webbrowser: system32/shdocvw.dll). This
    browser control provides me webpage, which will ask the user for data.
    When the button ok is clicked, the dialog will return the values from
    the webpage (from the elements with an: id) with the method:
    streetname = browser.Document.all("streetname").innerHTML.
    When all correct values are filled, then the dialog will close the vba
    will call the save as method, with the values filled in by the user.

    Thank you for you response! but too bad i saw i just now
     
    eywitteveen, Feb 5, 2007
    #3
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.