Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Start up file help

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Joe-Bouza
389 Views, 8 Replies

Start up file help

Hello

 

I have been hacking my way through a lisp file that would run on startup and set our company paths. The file I've come up with (with some help) does just that. This was my plan: I would send users a hyberlink that copies and acad.lsp file to there c:\program files\autodesk\<product>\support, being this is the first line in the OOTB search paths. That file loads a setpath.lsp file located outside the search paths. Its runs great and does what I need. The problem: I need a way to tell it to only run once per user or I keep getting duplicated search paths.

 

I don't know lisp. As I said I'm hacking my way to this end. I need some kind of conditional statement that identifies if the paths have already been set and if they have don't run the setpath lisp.

 

Any help is greatly appreciated.

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

8 REPLIES 8
Message 2 of 9
dmfrazier
in reply to: Joe-Bouza

There are probably more sophisticated ways to do this, but as I am not very sophisticated, here's a possible solution.

In your SETPATH.lsp, at the beginning, check the value of one of the built-in USERxx system variables (you get to choose which one; there are several, some meant for "real" number values, some for "integer" values, some for "string" values).  At the end, set this variable to something distinctive/recognizable.  Modify your code to do its thing only if the value is not what it would be if the code had already run.

 

For example:

(if (/= 1492 (getvar "useri2")); assuming you decide to use an integer
          (progn

            (etc...

            (setvar "useri2" 1492);set useri2=1492 after the important stuff

          )

          (else...

 

If you prefer, use one of your path variables instead.

 

I was wondering why using a profile (ARG) and a desktop icon doesn't work for what you are trying to do.

 

Message 3 of 9
Joe-Bouza
in reply to: dmfrazier


@dmfrazier wrote:

<snip>

 

I was wondering why using a profile (ARG) and a desktop icon doesn't work for what you are trying to do.

 


Im not very sophisticated either <G>

 

I am glad you have responded. I very well may be going down the wrong garden path. I have to deploy 2 suites with various products: civil3d, MEP, Vanill ACAD, Acad Architecture, Structural detailing, Map3d etc.

In years past I did do it with an arg file, but the way I did was not very efficient. I would walk around the office loading the arg file to every apps default profile and I'm just tired of it. Is there a way for me to create each profile arg and get it to each work station without the manual labor? That's why I headed this way. If you know a way I'd be very grateful.

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 4 of 9
dmfrazier
in reply to: Joe-Bouza

You used the word "deploy".  How is the software being installed? Are you aware of the ability to create (and would you be able to use) network deployments for installing on workstations?  If so, a profile can be specified in the deployment.  (I'm not the guy to give you specifics on that subject, but there are lots of resources available.)

 

If the deployment option is not available, then there is probably a way to modify your earlier concept to use an ARG file (exported from a prototype AutoCAD setup) instead of the setpath lisp.  You could still use your hyperlink to copy the ARG file and an acad.lsp to your chosen path.  The acad.lsp file could be modified to import the profile from that location.  The import could be made conditional based on the current profile.

 

Anything here sound promising?

Message 5 of 9
Joe-Bouza
in reply to: dmfrazier

It all sounds promising!

 

Yes I create a network deployment and then go to each work station to run the installer(or send the user a link; the way I prefer to do it). I know in the deployment I can specify a profile or leave the default, but I never figured out how to get the prototypical profile to run on each machine without manually importing it. If there were a way to pickup the arg automatically that would be great. Could you elaborate on how that can be done?

 

I ended up down this path after asking these questions and the lisp was the recommendation. I think I understand what you mean by copying the arg file, but how can I get the individual workstations to load the arg?

 

More on my earlier concept:

 

I researched the If and Cond commands and they look promising. I am looking at the Cond because it was easier for me to understand.

I tested this by manually resetting paths for the true false condition and had good results, but It all seems too complicated for someone other than me to monitor. 

 

This file seems like a start but it would have to get more complicated by checking which product is running , as each product has there own support path requirements

;
;This file would be loaded by the acad.lsp copied via hyper link to each works station
;
;
(defun check ()
 (setq *chk* (substr (getvar "acadprefix") 3 10));  sets *chk* to the first 10 characters of the current search paths string
(cond ((/= *chk* "CAMERONFS1");     the cond commad compares *chk* to a known value: "our server name"
       (princ "\nload "setc3d2014Paths");    if the condition is true we load the lisp file to set the paths
      ) ;_ end of the first then condition
      (t
       (princ "\nNothing to change.");    if the condition is false i.e our server name is already in the search path do nothing
      ) ;_ end of optional else condition
) ;_ end of cond statement
)

 

I really appreciate your help. I'm not good at working without a net <G>

 

Thanks

Joe

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 6 of 9
dmfrazier
in reply to: Joe-Bouza

"...how can I get the individual workstations to load the arg?"

 

This is where I envisioned your original concept of the acad.lsp would come in. This file could conditionally import and set current the desired profile, rather than calling another lisp to set the paths. (Again, I'm probably not the guy to give you specifics.)

 

"...I never figured out how to get the prototypical profile to run on each machine without manually importing it. If there were a way to pickup the arg automatically that would be great. Could you elaborate on how that can be done?"

 

I have been fuzzy on this myself as I only use deployments rarely, but I thought (apparently mistakenly) that it was possible to specify a profile in the deployment.  I have since realized that this isn't true (based on 2013 deployment setup).

 

However, given that your goal seems to be setting paths, couldn't this be done in the Search Paths and File Locations section while defining the deployment?

 

2013DeploymentPaths.png

 

"I'm not good at working without a net."

 

And if you ever did get good at it, you might not last very long.Smiley Wink

Message 7 of 9
Joe-Bouza
in reply to: dmfrazier

The deployment option for a particular profile is to set the name. I don't see any option there to tell it where to pick it up, say a customized arg. So if I were to overwrite the default profile name in the deployment wizard to be say: CEA Custom I'd get the nameand it would still get the default setting. It would be nice for sure.

 

I do set paths in the deployment fo products that it works. The problem is with Civil3d and MEP: The developers left out any options to set any paths for Civil3d in the deployment wizard, and MEP has the options available to set paths but they do not work; MEP installer reverts to the default paths. This is a known problem with the deployment wizard I have had a SR with autodesk regarding this. That was the genesis of my journey into lisp.

 

All that and I have Great news. My conditional statement works! Success feels great. Civil3d is conquered, and now onto MEP

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 8 of 9
dmfrazier
in reply to: Joe-Bouza

"The deployment option for a particular profile is to set the name."

Yes, I now understand that.  (Not a very useful option, it seems to me.)

 

"The developers left out any options to set any paths..."

Yes, I do remember seeing some posts about that.  For example:

http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/2011-Deployment-Customization/m-p/36543...

 

"My conditional statement works!"

Good to hear!  I hope my suggestions were somehow helpful.

 

Message 9 of 9
Joe-Bouza
in reply to: dmfrazier

Absolutley. Your conditional sample using the user data set the wheel turning for me to investigate the substr funciton to test for our server name.

Thanks again

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost