Author Topic: Modify Layer Creator Routine  (Read 1379 times)

0 Members and 1 Guest are viewing this topic.

therealjd

  • Mosquito
  • Posts: 11
Modify Layer Creator Routine
« on: May 28, 2013, 12:03:22 PM »
Hey folks,

I'm hoping someone here can help me figure out what's going on.

I love the layer creator routine, but I wanted to modify the layer creator routine made by Tim Spangler, to support multiple sub directories for layer files.

Originally, i wanted the subfolder as an argument, but wasn't sure how to do that without messing up the code, so i decided to just copy the routine and rename it. then rename the support folder the layer_creator.lsp was looking for.

so, LC01.lsp would reference subfolder '01', LC02.lsp would reference subfolder '02'.

this works if i manually load the lisp routine each time. However, if i've already loaded the lisp routines, it seems that calling up LC01 after LC02 was loaded, will give me the "02" subfolder.

it's like it's keeping the support path in memory or reading it from somewhere (registry?).

I've attached the LC02.lsp (just Layer_creator.lsp with path modification). LC01.lsp is identical except for the command name difference and support path name.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Modify Layer Creator Routine
« Reply #1 on: May 29, 2013, 05:00:17 AM »
It seems that the code is loading the path from registry yes:
Code - Auto/Visual Lisp: [Select]
  1. (vl-registry-read "HKEY_CURRENT_USER\\Software\\Layer Creator" "BaseDirectory")

You could simply have a few routines which set that registry value to some other folders before running Tim's code. Or have your variants of the LSP files set that registry value to whatever you need. Remember though: if you load LS01 and then LS02 - the defuns named the same would only be those from LS02 (they would have overwritten those from LS01).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.