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

Deploying custom hatch patterns using Installer

3 REPLIES 3
Reply
Message 1 of 4
ryan
308 Views, 3 Replies

Deploying custom hatch patterns using Installer

I am wanting to build an installer to deploy some custom hatch patterns.   Getting the hatch patterns onto disk is easy; however, I need to add this location as a support path (presumably via a registry entry) but the number of potential registry entries is huge given the combination of AutoCAD releases and verticals.   The other option I had was to deploy the hatches to the same location as ACAD.PAT and search for this location during installation.

 

FYI - I plan to use Inno Setup but am not opposed to another installer.

 

Any other ideas?

Thanks,

 

 Ryan

Ryan Small
National Team Leader, Data Management and Software Development
SolidCAD, a Cansel Company (an Autodesk Platinum Partner)
www.solidcad.ca
3 REPLIES 3
Message 2 of 4
pbejse
in reply to: ryan


@Ryan wrote:

I am wanting to build an installer to deploy some custom hatch patterns.   Getting the hatch patterns onto disk is easy; however, I need to add this location as a support path (presumably via a registry entry) but the number of potential registry entries is huge given the combination of AutoCAD releases and verticals.   The other option I had was to deploy the hatches to the same location as ACAD.PAT and search for this location during installation.

 

FYI - I plan to use Inno Setup but am not opposed to another installer.

 

Any other ideas?

Thanks,

 

 Ryan


Inside autocad is easy.

 

(if (and (setq location (findfile "acad.pat"))
	 (setq source (findfile "C:\\Source Folder\\pattern\\")) ;<-- server location or other drive
	 (setq location (strcat (vl-filename-directory location) "\\"))
    ) 

  (foreach fil (vl-directory-files source "*.lsp")
    (vl-file-copy (strcat source fil) (strcat location fil))
  ) ;_ end of foreach
) ;_ end of if

 

perhaps use a bat file to:

Search for path where acad.pat is located

Open and read the result ... edlin

Use the result for location argument

PushD

Copy file

Popd

end

 

 

HTH

 

 

 

 

Message 3 of 4
ryan
in reply to: pbejse

Appreciate the reply but unfortunately it doesn't completely answer my question.

 

Yes, I agree that adding the support path in AutoCAD is no problem; however, the whole purpose of the installer is to do a "1-click" installation of the hatch patterns so I don't want the users to have to then, after installation, go into AutoCAD and run another routine.   So, the SETUP.EXE needs to add the support path but in such a way as can accomodate for all the different AutoCAD variants - I'm not opposed to modifying ACAD.LSP through setup but again, I could have numerous ones (because of multiple acad versions to install) and so all would need to be modified.

Ryan Small
National Team Leader, Data Management and Software Development
SolidCAD, a Cansel Company (an Autodesk Platinum Partner)
www.solidcad.ca
Message 4 of 4
Kent1Cooper
in reply to: ryan


@Ryan wrote:

I am wanting to build an installer to deploy some custom hatch patterns.   Getting the hatch patterns onto disk is easy; however, I need to add this location as a support path (presumably via a registry entry) but the number of potential registry entries is huge given the combination of AutoCAD releases and verticals.   The other option I had was to deploy the hatches to the same location as ACAD.PAT and search for this location during installation.

....


If I'm understanding you correctly, your "other option" is pretty much what we do, but with what I think may be a meaningful difference.

 

If you put them in the same location as ACAD.pat, there shouldn't be any searching necessary, because AutoCAD will already have a location where it puts ACAD.pat, built into its configuration.  But since that location, if left to the AutoCAD installation, is going to be somewhere on the same computer with each installation, that would mean copying the custom pattern files into those locations on every computer, and "deploying" any more that come along later would also mean copying them separately onto every computer.

 

What we do instead is to put both native and custom hatch pattern definitions into one generic support folder on our Server, which goes at the top of everyone's Support File Search Path list, so that's the location where it finds any applicable-to-all-users files, in preference to any such files that are in different places down those interminable file paths for each installation.  It's the same location for everyone, so any installer would just need to add that and put it at the top of the list, and version differences shouldn't matter.  The only version effect I imagine you might have is that perhaps some newer versions could have more native patterns in them than older versions, or overlays might have more than basic AutoCAD.  In such cases, just put the most comprehensive version of ACAD.pat in that location, and you'll get the added benefit that some versions will gain access to patterns that didn't come with them.

 

Most of our custom patterns we actually have included within ACAD.pat itself [with a copy of the original file saved as ACADORIG.pat], so users don't even need to go into the "Custom" category to use them, or even know which patterns are custom -- they're in the same list as the native patterns.  That also spares the need to have a separate file for each custom pattern, though there are some that we leave that way just because we don't expect to use them much.  It also means we can get rid of any patterns we know we'll never use, to shorten the list [ESCHER is pretty interesting as an illustration of the potential of hatch patterns, but really, does anyone actually use it?].

 

Updating, whether editing existing custom pattern definitions, adding more, or even getting rid of some, then requires only working with the file(s) in that one location, and the changes/additions are immediately available to all, without needing to get into each installation to adjust anything.

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost