Greetings.
I now remember why I don't like the newer versions of ACAD yuck!
I need to open all files in a given directory, load a .lsp, issue a autolisp call, save the changes, close the dwg.
I will use DosLIB to obtain the directory and file info
In earlier version it is pretty straight forward.
I have to make this work in 2012...
psudo code
Get user input of the directory work with ( i can get this from getfiled )
Write to a script file for each dwg;
_.OPEN command
dwg name
(load "myfoo")
(my_foo)
_.CLOSE command
Then the user can manually run the .SCR file ( multiple times if necessary )
I've found some info on the sysvar SDI. I'm really not sure if this is way to go. When it errors out, it really doesn't give good info
By hand i can get 'CLOSE does not work with SDI 1'
By hand open does not need SDI =1, but it does in a script or code ?
How do you guys approach this scenario ?
Script so far ( not working )
(if (getvar "SDI") (setvar "SDI" 1))
(if (/= (getvar "DBMOD") 0)
(command "_.OPEN" "_Yes" "C:/ACADPROJ/TO/PARENT/GCIR001E")
(command "_.OPEN" "C:/ACADPROJ/TO/PARENT/GCIR001E"))
(if (getvar "SDI") (setvar "SDI" 0))
(load "NW_FOO")
(nw_foo "C:/ACADPROJ/TO/CHILD/")
(if (/= (getvar "DBMOD") 0)
(command "_.CLOSE" "_N")
(command "_.CLOSE"))
(if (getvar "SDI") (setvar "SDI" 1))
(if (/= (getvar "DBMOD") 0)
(command "_.OPEN" "_Yes" "C:/ACADPROJ/TO/PARENT/GCIR001P")
(command "_.OPEN" "C:/ACADPROJ/TO/PARENT/GCIR001P"))
(if (getvar "SDI") (setvar "SDI" 0))
(load "NW_FOO")
(nw_foo "C:/ACADPROJ/TO/CHILD/")
(if (/= (getvar "DBMOD") 0)
(command "_.CLOSE" "_N")
(command "_.CLOSE"))