Jump to content

Recommended Posts

Posted

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

 

 

 

Posted

I believe the backslash has to be double or one forward slash instead. 

  • Agree 1
  • Thanks 1
Posted

 

but it can open the first drawing, only it is interrupted and it no longer draws the circle or opens the second one.

Posted

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.

Posted (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 by rlx
Posted

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

Posted

 

It was the type of file

 

it already worked thanks

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...