All Activity
- Today
-
Halmir15 joined the community
-
xnxnj joined the community
-
Just a maybe, if you have used PLOT then selected a installed windows printer, then opened the custom settings to add sheet sizes etc it should save the pc3 to correct location. Ok the important bit, you should not need the pc3 in the printer name, for Autocad only use "Plot To Pdf". So for your custom plotter don't have the PC3. Same with sheet size must be an exact match. An example. (COMMAND "-PLOT" "Y" "" "Plot To PDF" "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "Acad.ctb" "Y" "n" "n" "n" pdfName "N" "y" )
- Yesterday
-
@Steven P I have tried but it gives same Yeah it show the correct folder.
-
(defun PDFgetplottername ( pdfpreview / pname PC3FilePath ) ;; Get the correct plotter name based on preview or not (setq pname "DWG to PDF.pc3") ;; Default fallback (defun PDFgetplottername ( pdfpreview / pname PC3FilePath ) ;; Get the correct plotter name based on preview or not (setq pname "DWG to PDF.pc3") ;; Default fallback This will need to change as well I think Does PC3Loc return the correct folder?
-
@Steven P Hi bro, I have tried this and modified but I don't know is this right. (defun PC3Name ( / ) ;; Name of custom Plot Configuration PC3 File ;; This is the Plot Configuration PC3 file used when you check the 'Preview PDF' checkbox ;; otherwise it uses 'DWG to PDF.pc3' "Foxit PDF Editor Printer.pc3" ) (defun PC3Loc ( / PCP PC3LOC ) ;; Location of custom Print Configuration PC3 files ;; Note standard and no preview PC3 files are to be in the same location (setq PC3Loc (vla-get-PrinterConfigPath (vla-get-Files (vla-get-Preferences (vlax-get-acad-object))))) PC3LOC ) (defun PDFgetplottername ( pdfpreview / pname PC3FilePath ) ;; Get the correct plotter name based on preview or not (setq pname "DWG to PDF.pc3") ;; Default fallback (if (findfile (setq PC3FilePath (strcat (PC3Loc) "\\" (PC3Name)))) (setq pname (PC3Name)) ) (if (= pdfpreview "N") (if (findfile (setq PC3FilePath (strcat (PC3Loc) "\\" (PC3NameNP)))) (setq pname (PC3NameNP)) ) ) pname ) (defun PC3Exists (pc3name / fullpath) (setq fullpath (strcat (PC3Loc) "\\" pc3name)) (findfile fullpath) ) (defun C:PDF1 ( / cm pc3name paperName ) (vl-load-com) (setq cm (getvar 'CMDECHO)) (setvar 'CMDECHO 0) ;; Define your desired PC3 file and paper size (setq pc3name "Foxit PDF Editor Printer.pc3") (setq paperName "ARCH D") ;; or exact size from your PC3 ;; Only proceed if the PC3 file exists (if (PC3Exists pc3name) (progn (command "_.-plot" "_y" (if (= 1 (getvar 'TILEMODE)) "Model" (getvar 'CTAB)) pc3name paperName "_M" "_L" "_N" "_E" "_F" "_C" "_Y" "Free State.ctb" "_Y" ) (if (= 1 (getvar 'TILEMODE)) (command "_A") (command "_N" "_Y") ) (command "_N" (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)) ".pdf") "_Y" "_Y" ) ) (prompt (strcat "\nPC3 file not found: " pc3name)) ) (setvar 'CMDECHO cm) (princ) ) But after that it shows like "Command: PDF1 PC3 file not found: Foxit PDF Editor Printer.pc3" The custom.pc3 file were saved in same as the default file/location. I don't know what I did wrong.
-
s_dhake2002 joined the community
-
@SLW210 I have paste the file path instead paste the "Foxit PDF Editor Printer.pc3". No difference. And also custom.pc3 file were saved in same location as default.
-
Steven P started following custom .pc3 not supported
-
For PC3 files, if I remember, I couldn't get LISP to create one so you'll need to set them all up and save the configuration files. It would help if you save them in the default file location A couple of snippets I have, This gives the default PC3 file location: (defun PC3Loc ( / PCP PC3LOC) ;;Location of custom Print Configuration PC3 files ;;modify if you want a different location from the default AutoCAD location ;;Note standard and no preview PC3 files are to be in the same location for it to work well. (setq PC3Loc (vla-get-PrinterConfigPath (vla-get-Files (vla-get-Preferences (vlax-get-acad-object))))) PC3LOC ) This one checks that the PC3 file exists - defined in the PC3NAME lisp (defun PC3Name ( / ) ;;Name of custom Plot Configuration PC3 File ;;This is the Plot Configutation PC3 file used when you check the 'Preview PDF' checkbox ;;otherwise it uses 'DWG to PDF.pc3' "DWG to PDF.pc3" ) (defun PDFgetplottername( pdfpreview / pname) ;;this needs to be set up in pagesetup settings (setq pname "DWG to PDF.pc3") ;;Default DWG to PDF plotter (if (findfile (setq PC3FilePath (strcat (PC3Loc) "\\" (PC3Name))) ) (setq pname (PC3Name)) );;end if (if (= pdfpreview "N") ;;get custom PC3 file name (if (findfile (setq PC3FilePath (strcat (PC3Loc) "\\" (PC3NameNP))) ) (setq pname (PC3NameNP)) );;end if );;end if pname ) where my Dwg to PDF.PC3 is my PDF plotter setting file
-
No I just entered the name of .pc3. let me try that too. But both custom .pc3 and DWG to pdf .pc3 are located in same folder.
-
Did you try to hard code the full path to the .pc3? i.e. C:PathtoPC3folder/Foxit PDF Editor Printer.pc3
-
Hence the reason the OP needs to respond with more than... I could test hings in LT when I get to work, but I would only do that for my own needs. If OP wants a solution they should be more responsive, IMO. The easy solution here is upgrade those that would need to use API calls to full AutoCAD.
-
Thanks for your help @SLW210
-
I moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the appropriate forum.
-
sameturk94 joined the community
-
lilian_100 joined the community
-
Yes, correct, I meant on that
-
-
@GLAVCVS, I tryed with "acLineSpacingStyleAtLeast", where the default value is 1 (acLineSpacingStyleAtLeast = 1). But, if you want different number than "1", definetly need to change "acLineSpacingStyleAtLeast" with desired value. As always, you're the man, thanks!
-
Just one detail: it might be necessary to replace 'acLineSpacingStyleAtLeast' with 1 for MLEADERs as well.
-
harimaddddy started following Spacing text efficiently
-
Saxlle started following line space factors
-
Hi @masterfal, I don't know what do you want to achieve with this: (vl-catch-all-apply (function (lambda () (setq mtextObj (vlax-invoke ent 'GetMText)) (if mtextObj (progn (setq newText (vla-AddMText (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-get-insertionpoint mtextObj) (vla-get-width mtextObj) (vla-get-TextString mtextObj) ) ) but there is several issues in this code, like: 'GetMText doesn't exist as Method, you can't use "acLineSpacingStyleAtLeast" as variable to store the value, etc. You can try with this: (defun c:LSFsel ( / ss i ent obj acLineSpacingStyleAtLeast mtextObj newText) (vl-load-com) (if (setq ss (ssget)) (progn (setq i 0) (while (< i (sslength ss)) (setq ent (vlax-ename->vla-object (ssname ss i))) (cond ;; MText: apply directly ((= (vla-get-objectname ent) "AcDbMText") (vla-put-LineSpacingStyle ent 1) (vla-put-LineSpacingFactor ent 0.8) ) ;; MLeader: rebuild MText ((= (vla-get-objectname ent) "AcDbMLeader") (vla-put-TextLineSpacingStyle ent acLineSpacingStyleAtLeast) (vla-put-TextLineSpacingFactor ent 0.80) ) ) (setq i (1+ i)) ) (princ "\n? Line spacing factor set to 0.8 for selected items.") ) (princ "\n?? No objects selected.") ) (princ) ) Try it, and see if it's helpful.
-
harimaddddy started following custom .pc3 not supported
-
Hi Everyone, Good day to all, I'm trying to customize a LISP routine to create PDFs using my own .pc3 and ctb file — specifically, I'm using "Foxit PDF Editor Printer.pc3". I tried replacing the default printer and setting a custom paper size, but the code isn’t working as expected. (defun c:PDF ( / cm ) (setq cm (getvar 'CMDECHO)) (setvar 'CMDECHO 0) (command "_.-plot" "_y" (if (= 1 (getvar 'TILEMODE)) "Model" (getvar 'CTAB)) "AutoCAD PDF (High Quality Print).pc3" "ARCH D (24.00 x 36.00 Inches)" "_M" "_L" "_N" "_E" "_F" "_C" "_Y" "monochrome.ctb" "_Y" ) (if (= 1 (getvar 'TILEMODE)) (command "_A") (command "_N" "_Y") ) (command "_N" (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME))) "_Y" "_Y") (setvar 'CMDECHO cm) (princ) ) (vl-load-com) (princ) When I replace the default .pc3 file in the LISP code with my own (Foxit PDF Editor Printer.pc3), instead of plotting automatically, it starts asking for every input again — like paper size, plot area, etc Command: PDF Yes or No, please. Don't use Esc while using a Lisp commandWrite the plot to a file [Yes/No] <N>: y Command: MOPRINT Yes or No, please. Don't use Esc while using a Lisp commandWrite the plot to a file [Yes/No] <N>: Save changes to page setup [Yes/No]? <N> Proceed with plot [Yes/No] <Y>: Effective plotting area: 903.11 wide by 603.25 high Plotting viewport 1. Effective plotting area: 792.73 wide by 577.98 high Plotting viewport 2. Also, it would be awesome if we could add a feature where each layout gets plotted using a name format and save location pulled from an Excel file. That would seriously save a ton of time and effort. Thanks in advance, friends!
-
WalterCox84 changed their profile photo
-
arman jade tivar joined the community
-
masterfal started following line space factors
-
hi all, i have a lisp routine i've been trying to set up to quickly update the line space factors of selected text to 0.8. now i've got it working ok for multiline text but i want it to also include multileaders. after running its picking the multileaders and then telling me the change to 0.8 has been completed but in reality the multileaders havent been updated. they are still 1. any ideas how i can get them to update? (defun c:LSFsel ( / ss i ent obj acLineSpacingStyleAtLeast mtextObj newText) (vl-load-com) (setq acLineSpacingStyleAtLeast 1) (if (setq ss (ssget)) (progn (setq i 0) (while (< i (sslength ss)) (setq ent (vlax-ename->vla-object (ssname ss i))) (cond ;; MText: apply directly ((= (vla-get-objectname ent) "AcDbMText") (vla-put-LineSpacingStyle ent acLineSpacingStyleAtLeast) (vla-put-LineSpacingFactor ent 0.8) ) ;; MLeader: rebuild MText ((= (vla-get-objectname ent) "AcDbMLeader") (vl-catch-all-apply (function (lambda () (setq mtextObj (vlax-invoke ent 'GetMText)) (if mtextObj (progn (setq newText (vla-AddMText (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-get-insertionpoint mtextObj) (vla-get-width mtextObj) (vla-get-TextString mtextObj) ) ) (vla-put-LineSpacingStyle newText acLineSpacingStyleAtLeast) (vla-put-LineSpacingFactor newText 0.8) (vlax-invoke ent 'SetMText newText) (vla-delete newText) ; cleanup temp MText ) ) ) ) ) ) ) (setq i (1+ i)) ) (princ "\n Line spacing factor set to 0.8 for selected items.") ) (princ "\n No objects selected.") ) (princ) )
-
Albertogm joined the community
-
Andywen2 joined the community
- Last week
-
Like others write same script file all the time then only one ever exists. Part 2 I reset my temporary directory to a top level "d:\acadtemp" much easier to find, you may be horrified as to how much junk is in there. To reset or find, Options, Files,"Temporary directory"" Save Multi toggles to a support directory as its auto loaded. cleanup temp.lsp Multi toggles.lsp
-
Spacing text efficiently
BIGAL replied to benjs1's topic in AutoCAD 2D Drafting, Object Properties & Interface
Welcome aboard. 2nd need sample dwg. -
Thanks @BlackBox for testing.
-
Below is my batch routine, search it for (setq batchfiletype "*.dwg") and modify it to (setq batchfiletype "*.dxf") t osee if it works.
-
Steven P started following Batch run a lisp program
-
Delete script file: Just my paranoia that I will set up the delete to remove the wrong thing, I set my temporary script files to have the same name for each function and then next time I run the function this script file is overwritten. I do the same with DCL 'on the fly' code and temporary files from that. A third thing I do is save these files in the temporary files location (and BIgAl has a handy routine to clear the temporary files out - unless I renamed it look on this site for 'cleanuptemp' - run as and when you want) This is what I use to write to temporary files (setq fo (open (setq fname (vl-filename-mktemp "-File_Nme-" (getvar "TEMPPREFIX") ".scr")) "w")) where fo is the pointer in the LISP to the script file being created
-
Spacing text efficiently
eldon replied to benjs1's topic in AutoCAD 2D Drafting, Object Properties & Interface
Considering the many different places that text could be moved, I think that there will never be a completely clear drawing produced without manual intervention. In some congested instances, I have been known to use leaders to show which ground level refers to which spot. Text size is also a significant factor. -
FWIW, neither my ADN nor work's AEC Collection subscriptions give me access to LT (full versions only).