Project based session & search paths issue...

Discussion in 'AutoCAD' started by devon, Jun 4, 2004.

  1. devon

    devon Guest

    Hi,

    I currently have some customisation that prompts the user with a 'project' dcl at the start of a new drawing. This has a pop down list of the current projects we are working on and when you select a project, the dcl/lisp then look at a "project.inf" file in that project's directory.

    This inf file holds project specific information such as UCS's, title blocks availible, models used in the sheets and sheet scales.

    This file is then read while creating the drawing and I have a series of dialogues that utilise the inf information to aid consistancy.

    The question I have is...

    Can i have code in this inf file that changes the default AutoCAD search paths to project specific locations for things like 'design center' 'insert' ?(currently AutoCAD looks in the last location used for both of these)


    Can I also add the function that other dialogues that also 'view' the inf, highlight the current project used, rather than having to select the project again from each dcl's pop down list? (currently it shows the 1st project listed and you have to reselect the project used)

    Any input would be great.
    Thanks in advance.
     
    devon, Jun 4, 2004
    #1
  2. devon

    John Guest

    I have been looking at something similar myself. What I have so far is a
    function that reads in the ACAD var and splits the string at the semicolons
    to create a list of the current paths: (path1, path2, path3)

    Next I have another functions that takes a list of new paths as an arg
    (addPath1, addPath2) It compares the two list to make sure their is no
    duplication of paths and adds any new paths to a master list.
    This list is then converted back to a semicolon deliminated string by
    another function and the ACAD var is set to this new path list.

    All the above function get fired off by reactors when a drawing is opened.

    This works so far. What I am now trying to figure out is how to best clean
    up the paths after a drawing is closed, or when multiple project drawings
    are open.

    John
    Hi,

    I currently have some customisation that prompts the user with a 'project'
    dcl at the start of a new drawing. This has a pop down list of the current
    projects we are working on and when you select a project, the dcl/lisp then
    look at a "project.inf" file in that project's directory.

    This inf file holds project specific information such as UCS's, title blocks
    availible, models used in the sheets and sheet scales.

    This file is then read while creating the drawing and I have a series of
    dialogues that utilise the inf information to aid consistancy.

    The question I have is...

    Can i have code in this inf file that changes the default AutoCAD search
    paths to project specific locations for things like 'design center' 'insert'
    ?(currently AutoCAD looks in the last location used for both of these)


    Can I also add the function that other dialogues that also 'view' the inf,
    highlight the current project used, rather than having to select the project
    again from each dcl's pop down list? (currently it shows the 1st project
    listed and you have to reselect the project used)

    Any input would be great.
    Thanks in advance.
     
    John, Jun 4, 2004
    #2
  3. devon

    Matt W Guest

    The initial 'insert' directory is stored in the registry here (this is for
    ABS4):
    My
    Computer\HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.0\ACAD-206:409\Prof
    iles\Building Systems\Dialogs\SelectDrawingFileB\InitialDirectory

    You could use VLISP to read/write to the registry for this one.

    Same thing for the Design Center (again, this is from ABS4):
    My
    Computer\HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.0\ACAD-206:409\Auto
    deskApps\AcadDC\History\DesignCenter\Last State

    Hope this helps!

    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.

    "John burnsmcd dotcom>" <jherrman <at> wrote in message
    | I have been looking at something similar myself. What I have so far is a
    | function that reads in the ACAD var and splits the string at the
    semicolons
    | to create a list of the current paths: (path1, path2, path3)
    |
    | Next I have another functions that takes a list of new paths as an arg
    | (addPath1, addPath2) It compares the two list to make sure their is no
    | duplication of paths and adds any new paths to a master list.
    | This list is then converted back to a semicolon deliminated string by
    | another function and the ACAD var is set to this new path list.
    |
    | All the above function get fired off by reactors when a drawing is opened.
    |
    | This works so far. What I am now trying to figure out is how to best
    clean
    | up the paths after a drawing is closed, or when multiple project drawings
    | are open.
    |
    | John
    |
    | >>> devon<> 6/3/2004 6:52:26 PM >>>
    | Hi,
    |
    | I currently have some customisation that prompts the user with a 'project'
    | dcl at the start of a new drawing. This has a pop down list of the current
    | projects we are working on and when you select a project, the dcl/lisp
    then
    | look at a "project.inf" file in that project's directory.
    |
    | This inf file holds project specific information such as UCS's, title
    blocks
    | availible, models used in the sheets and sheet scales.
    |
    | This file is then read while creating the drawing and I have a series of
    | dialogues that utilise the inf information to aid consistancy.
    |
    | The question I have is...
    |
    | Can i have code in this inf file that changes the default AutoCAD search
    | paths to project specific locations for things like 'design center'
    'insert'
    | ?(currently AutoCAD looks in the last location used for both of these)
    |
    |
    | Can I also add the function that other dialogues that also 'view' the inf,
    | highlight the current project used, rather than having to select the
    project
    | again from each dcl's pop down list? (currently it shows the 1st project
    | listed and you have to reselect the project used)
    |
    | Any input would be great.
    | Thanks in advance.
    |
    |
     
    Matt W, Jun 4, 2004
    #3
  4. devon

    devon Guest

    Thanks for the replys.

    Thinking about it alittle more, It would be handy to incorporate the 'current project' path into these triggers so the current acad session would look into every path under the main one for files. eg xrefs.

    Would anyone care to show me some code that may do the trick for this and what was discussed above?

    Thanks for your help.
     
    devon, Jun 7, 2004
    #4
  5. devon

    Matt W Guest

    You could use this to set the "default" insert directory...
    Note the change "SelectDrawingFileBlkDlg". I gave you the wrong RegKey last
    time.

    (defun c:RegWrite ()
    (vl-registry-write
    "HKEY_CURRENT_USER\\Software\\Autodesk\\AutoCAD\\R16.0\\ACAD-206:409\\Profil
    es\\Building Systems\\Dialogs\\SelectDrawingFileBlkDlg\\" "InitialDirectory"
    "E:\\Temp")
    (princ)
    )

    Load this, type RegWrite, then insert a block. The insert dialog will look
    to E:\Temp instead of the last place you inserted a block from.

    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.

    | Thanks for the replys.
    |
    | Thinking about it alittle more, It would be handy to incorporate the
    'current project' path into these triggers so the current acad session would
    look into every path under the main one for files. eg xrefs.
    |
    | Would anyone care to show me some code that may do the trick for this and
    what was discussed above?
    |
    | Thanks for your help.
     
    Matt W, Jun 7, 2004
    #5
  6. devon

    devon Guest

    Thanks for the reply matt,

    Problem is that I can't get this regedit to execute from my text inf file.

    I can run it in a seperate lisp, but can't get AutoCAd reading it from the inf file at startup.

    Everything else I have in this inf file gets read fine.

    This is really stumping me.

    Any help is most appreciated.

    Thanks
    Devon
     
    devon, Jun 15, 2004
    #6
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.