leonucadomi Posted December 7, 2023 Share Posted December 7, 2023 hello all: I am using for the first time Script Writer of master Lee Mac then I try to open two drawings , even use the example _.open "C:\My Folder\Drawing1.dwg" _.circle 0,0,0 5 _.save _Y _.close _.open "C:\My Folder\Drawing2.dwg" _.circle 0,0,0 5 _.save _Y _.close and it only opens a drawing, it doesn't even draw the circle Does anyone know what could be happening? I use autocad 2013 I appreciate any advice thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 7, 2023 Share Posted December 7, 2023 I believe the backslash has to be double or one forward slash instead. 1 1 Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted December 7, 2023 Author Share Posted December 7, 2023 but it can open the first drawing, only it is interrupted and it no longer draws the circle or opens the second one. Quote Link to comment Share on other sites More sharing options...
Steven P Posted December 7, 2023 Share Posted December 7, 2023 Not sure what you are entering into the dialogue box, the example he uses is this to do the same: _.open *file* _.circle 0,0,0 5 _.save _Y _.close Where *file* is not the filename as your example text above, it is a marker to tell the LISP to use the files that the LISP finds - so should be entered as *file* Might be telling you something you know allready. Quote Link to comment Share on other sites More sharing options...
rlx Posted December 7, 2023 Share Posted December 7, 2023 (edited) You should press F2 after script has stopped then you can check your output and see what's happening. In your script you use save but if files already exists acad will ask if you want to overwrite this file (even though you use Y for this) . So maybe use qsave or setvar expert to 5 or something. for traveling to flatland you could place this in your startup lispfiles : ; Flatten a 3D drawing ; Written by Eduard ; This command will set all elevations and points to zero, efectively flattening any 3D drawing. ; (defun c:flat (/ total-nabor) (vl-load-com) (if (setq total-nabor (ssget "x" '((410 . "model")))) (progn (setq total-nabor (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex total-nabor) ) ;_ end of mapcar ) ;_ end of mapcar ) ;_ end of setq (foreach i '(1e99 -1e99) (mapcar (function (lambda (x) (vla-move x (vlax-3d-point (list 0 0 0)) (vlax-3d-point (list 0 0 i)) ) ;_ end of vla-move ) ;_ end of lambda ) ;_ end of function total-nabor ) ;_ end of mapcar ) ;_ end of foreach ) ;_ end of progn ) ;_ end of if (princ) ) ;_ end of defun then your script would be like open your filename (c:flat) .qsave close and if you have express tools you can use the flatten command Edited December 7, 2023 by rlx Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted December 7, 2023 Author Share Posted December 7, 2023 after saving there are two spaces, but even using one doesn't work for me I don't know if I have any variables incorrectly, what I'm looking for is to lower all the objects to z0, in several drawings but with a script Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted December 8, 2023 Author Share Posted December 8, 2023 It was the type of file it already worked thanks Quote Link to comment Share on other sites More sharing options...
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.