See the top rated post in this thread. Click here

Results 1 to 5 of 5

Thread: Removing "for each tab" function

  1. #1
    Member
    Join Date
    2019-05
    Posts
    15
    Login to Give a bone
    0

    Default Removing "for each tab" function

    For the life of me, I can not seem to successfully remove the "for each tab" function, and make this PlotPDF for one tab (current) only.

    I thought it would be so simple! Please help me, what am I missing!?

    Code:
    (defun C:Gen-Plot-Single-PDF (/ savepath tab dname)
    
    			(setvar "filedia" 0)
      
    	(setq savepath (strcat (getvar "DWGPREFIX") "ProgressPrints\\"))
      
    	(setq PathTest (C:Gen-CreateDirectory savepath))
    
      	(if (= PathTest T)
    	(progn  
      		(foreach tab (layoutlist)
    	  		(if (= (length (layoutlist)) 1)
    				(setq	dname (strcat savepath (vl-string-subst (strcat " " tab) ".dwg" (getvar "dwgname"))))
    				(setq	dname (strcat savepath (vl-string-subst (strcat "-" tab) ".dwg" (getvar "dwgname"))))
    			)
        			(setvar "ctab" tab)
    	  					
    			(command "-plot" "y" tab "DWG to PDF.pc3" "" "m" "l" "n" "l" "" "" "y" "" "y" "n" "n" "n" dname "n" "y")
    			;SOLVE: if theres eror = prompt 
    		)
    	  );progn
    	(princ "Failed to create folder path. Please create \"ProgressPrints\" file path manually in build folder")
    	);if
    		
      		(setvar "filedia" 1)
      	(princ)
    );defun

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    1

    Default Re: Removing "for each tab" function

    Hi,
    Something like this ?
    NOTE: I don't think that you need to disable the system variable FILEDIA since you already have used the dash symbol before the plot command and this won't show the dialog in any case unless you have it for something else.
    Code:
    (defun C:Gen-Plot-Single-PDF (/ tab savepath PathTest dname)
      (if (= (setq tab (getvar "ctab")) "Model")
        (alert "Must be on layout tab to continue.")
        (progn
          (setvar "filedia" 0)
          (setq savepath (strcat (getvar "DWGPREFIX") "ProgressPrints\\"))
          (setq PathTest (C:Gen-CreateDirectory savepath))
    
          (if PathTest
            (progn
              (setq dname (strcat savepath (vl-string-subst (strcat " " tab) ".dwg" (getvar "dwgname"))))
              
             (command "-plot" "y" tab "DWG to PDF.pc3" "" "m" "l" "n" "l" "" "" "y" "" "y" "n" "n" "n" dname "n" "y")
    
          )
        (princ "Failed to create folder path. Please create \"ProgressPrints\" file path manually in build folder")
        ) 
          (setvar "filedia" 1)
          )
        )
      (princ)
    )

  3. #3
    Member
    Join Date
    2019-05
    Posts
    15
    Login to Give a bone
    0

    Default Re: Removing "for each tab" function

    Yes Yes YEEEEESS!! Thank you so much.

    Ok, I wasn't too sure how important that was either, as it seemed to work fine without it.

    Thanks again!!

  4. #4
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    559
    Login to Give a bone
    0

    Default Re: Removing "for each tab" function

    This will plot a range or just 1 layout
    Attached Files Attached Files

  5. #5
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Removing "for each tab" function

    Quote Originally Posted by mruu88781911 View Post
    Yes Yes YEEEEESS!! Thank you so much.

    Ok, I wasn't too sure how important that was either, as it seemed to work fine without it.

    Thanks again!!
    Excellent.
    You're most welcome.

Similar Threads

  1. Replies: 2
    Last Post: 2016-12-22, 01:02 PM
  2. For each...next within for each...next
    By CADfunk MC in forum VBA/COM Interop
    Replies: 2
    Last Post: 2009-05-15, 05:01 PM
  3. Replies: 5
    Last Post: 2009-04-17, 10:10 AM
  4. Revit removing my tab-indenting on blocks of text
    By AaronC in forum Revit MEP - General
    Replies: 2
    Last Post: 2008-11-19, 04:17 PM
  5. Saving each Tab separately to own DWG file
    By todd.mackay in forum AutoLISP
    Replies: 8
    Last Post: 2005-12-14, 03:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •