Thanks Lee, your suggestion to use a registry key as the test works the way I want. I added this to my acaddoc.lsp:
- (setq reg_key (strcat "HKEY_CURRENT_USER\" (vlax-product-key) \\Fixed Profile\\General"))(setq read_reg_key (vl-registry-read reg_key "TEST"))(if (= read_reg_key "YES") (c:load_dwg_props))
Then in my new_project.lsp, right before the command to open the template, I added:
- (vl-registry-write reg_key "TEST" "YES")
Finally, in the load_dwg_props.lsp I added this line to the top of the code:
- (vl-registry-write reg_key "TEST" "NO")
I've tested this over and over and it works now but I'm sure there will be some situation or configuration where this code might not work. Is there anything you would suggest to improve this code?
Thanks again. |