BtreeTech Posted February 9 Posted February 9 As I am using LT 2024, have limited programming skills and need to open and close a number of files I am trying to use a script (.scr) file not a lisp or VBA. The script below does some basic cleaning of files exported from GIS and saves the DXFs as DWGs but I would like this to use relative paths (relative to the working file) so I can avoid changing the paths for each project. Is there a way in can set the paths based on the current open file? _.open "T:\DXF output\Canopies and Boles.dxf" _.Zoom E _.PURGE all * N _.save LT2018 "T:\DXF output\Canopies and Boles.dwg" Y _.close _.open "T:\DXF output\LabelLines.dxf" _.Zoom E _.PURGE all * N _.save LT2018 "T:\DXF output\LabelLines.dwg" Y _.close _.open "T:\DXF output\LabelText.dxf" _.Zoom E _.PURGE all * N _.save LT2018 "T:\DXF output\LabelText.dwg" Y _.close _.open "T:\DXF output\LabelWhiteOuts.dxf" _.Zoom E _.PURGE all * N _.save LT2018 "T:\DXF output\LabelWhiteOuts.dwg" Y _.close _.open "T:\DXF output\RPAs.dxf" _.Zoom E _.PURGE all * N _.save LT2018 "T:\DXF output\RPAs.dwg" Y _.close _.open "T:\DXF output\Tree Markers.dxf" _.Zoom E _.PURGE all * N _.save LT2018 "T:\DXF output\Tree Markers.dwg" Y _.close _.open "T:\DXF output\Zones Boles Canopies.dxf" _.Zoom E _.PURGE all * N _.save LT2018 "T:\DXF output\Zones Boles Canopies.dwg" Y _.close Quote
Steven P Posted February 9 Posted February 9 I think the script line needs the full file path, what I do is have a control where I build up the functions I want, select the files to work on and press 'go'. In the background this creates a temporary script file writing all the details - functions to run, filepaths and so on but now it works I don't need to worry about that. I would recommend this from Lee Mac: https://lee-mac.com/scriptwriter.html - though LT2024 is limited with the LISP / VBA functions it can run, it might work. Very simple, as described you build up the routine and it does the hard work of creating the script file. You can save the basic of the routine for later use on a different sat / same set / edit for something else./ Quote
BIGAL Posted February 9 Posted February 9 Another suggestion as you have lisp in LT 24 I would write the script calling a lisp file. You can load a lisp then call it (dxfspecial dwgname) Possible script (load "dxfspecial") (dxfspecial "Canopies and Boles") (load "dxfspecial") (dxfspecial "Canopies and Boles2") (load "dxfspecial") (dxfspecial "Canopies and Boles3") 1 Quote
BtreeTech Posted February 12 Author Posted February 12 @BIGAL I think your nested approach is probably they way to go, now I have to try and figure out the lisp. Quote
Lee Mac Posted February 12 Posted February 12 I have also provided a suggestion in response to your question on StackOverflow. Quote
BtreeTech Posted February 13 Author Posted February 13 @Lee Mac Many thanks, I'm still not sure where is the best place to go for help with AutoCAD is Quote
Lee Mac Posted February 13 Posted February 13 3 hours ago, BtreeTech said: @Lee Mac Many thanks, I'm still not sure where is the best place to go for help with AutoCAD is For help with the application, I would suggest here at CADTutor; for programming help, I would suggest TheSwamp.org or StackOverflow (though the latter does not have a large CAD community). 1 Quote
Steven P Posted February 13 Posted February 13 28 minutes ago, Lee Mac said: For help with the application, I would suggest here at CADTutor; for programming help, I would suggest TheSwamp.org or StackOverflow (though the latter does not have a large CAD community). Kind of missed my favourite online resource there Lee..... (a great repository for LISP snippets to study and learn from) Quote
BIGAL Posted February 13 Posted February 13 Best place to go there are more, forums/autodesk,Augi. But please don't double post at every other forum. It can take a day or two to get a correct answer to your problem. Always google 1st with "Autocad lisp" on end of search. eg "Extract attributes csv autocad lisp" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.