Jump to content

New to lisp-can't get 'simple' routine to consistantly run.


Recommended Posts

Posted

Lee Mac, one more clean up thing. I thought I'd change my "nfcoff.lsp" to the same way you did with the "nfcon.lsp" using VL. Am I correct in changing the first line (defun c:nfcoff (/lay app) and the 12th line (vla-put-freeze lay :vlax-true)) in order to make them both match?

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • tofuannie

    14

  • Lee Mac

    13

Popular Days

Top Posters In This Topic

Posted

:oops: Lee, not to be greedy with your time, but I'll ask.

 

Is it possible to actually "pick" a range of drawings from the first "wScript" run? I ask bc in the folder dialog box that comes up with wScript I might need to pick some drawings over other drawings that all reside in the same folder. Kind of like when I run the "script" line and it drills into the actual folder allowing me to pick a specific file.

 

thanks

Posted

The "nfcoff" turns the "nfc" layer off, where the "nfcon" turned the layer on.

Posted
:oops: Lee, not to be greedy with your time, but I'll ask.

 

Is it possible to actually "pick" a range of drawings from the first "wScript" run? I ask bc in the folder dialog box that comes up with wScript I might need to pick some drawings over other drawings that all reside in the same folder. Kind of like when I run the "script" line and it drills into the actual folder allowing me to pick a specific file.

 

thanks

 

Hmmm.. thats not too easy. Could you not copy the drawings you want to process into a temporary folder?

 

The "nfcoff" turns the "nfc" layer off, where the "nfcon" turned the layer on.

 

Bear in mind that the code you originally posted and the VL code I posted thaws the layer and doesn't turn it on/off.

 

These may give you some help:

 

(defun c:nfcthaw (/ lay app)
 (vl-load-com)

 (if (not (vl-catch-all-error-p
            (setq lay
              (vl-catch-all-apply
                (function vla-item)
                  (list (vla-get-layers                           
                          (vla-get-ActiveDocument
                            (setq app (vlax-get-acad-object)))) "tb|nfc")))))
   
   (vla-put-[b][color=Red]freeze [/color][/b]lay :vlax-[b][color=Red]false[/color][/b]))

 (vla-ZoomExtents app)
 (vla-save (vla-get-ActiveDocument app))
 
 (princ))

(defun c:nfcfrze (/ lay app)
 (vl-load-com)

 (if (not (vl-catch-all-error-p
            (setq lay
              (vl-catch-all-apply
                (function vla-item)
                  (list (vla-get-layers                           
                          (vla-get-ActiveDocument
                            (setq app (vlax-get-acad-object)))) "tb|nfc")))))
   
   (vla-put-[b][color=Red]freeze [/color][/b]lay :vlax-[b][color=Red]true[/color][/b]))

 (vla-ZoomExtents app)
 (vla-save (vla-get-ActiveDocument app))
 
 (princ))

(defun c:nfcon (/ lay app)
 (vl-load-com)

 (if (not (vl-catch-all-error-p
            (setq lay
              (vl-catch-all-apply
                (function vla-item)
                  (list (vla-get-layers                           
                          (vla-get-ActiveDocument
                            (setq app (vlax-get-acad-object)))) "tb|nfc")))))
   
   (vla-put-[b][color=Red]layeron [/color][/b]lay :vlax-[b][color=Red]true[/color][/b]))

 (vla-ZoomExtents app)
 (vla-save (vla-get-ActiveDocument app))
 
 (princ))

(defun c:nfcoff (/ lay app)
 (vl-load-com)

 (if (not (vl-catch-all-error-p
            (setq lay
              (vl-catch-all-apply
                (function vla-item)
                  (list (vla-get-layers                           
                          (vla-get-ActiveDocument
                            (setq app (vlax-get-acad-object)))) "tb|nfc")))))
   
   (vla-put-[color=Red][b]layeron [/b][/color]lay :vlax-[color=Red][b]false[/b][/color]))

 (vla-ZoomExtents app)
 (vla-save (vla-get-ActiveDocument app))
 
 (princ))

Posted
:) Yes, that would work...I can copy them to a temp folder and thanks for laying out the freeze/thaw and on/off differences for me. I promise I'm done! You've been so much help.

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...