Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/07/2025 in all areas

  1. Incremental Numbering Suite Version 4.0 Released. The main feature of the new version is the introduction of a dedicated 'Content Builder' to facilitate the construction of an incrementing string from an arbitrary number of incrementing and/or static components. With this feature, the user now has the ability to independently control the increment amount and increment frequency for each component of the string, enabling multiple sections of the string to increment by different amounts and at different rates to one another. The new version also introduces the ability to load & save application configurations, streamlining the operation of the program for multiple numbering systems.
    2 points
  2. Not sure if this will make any difference, this is a stripped down version of my PDF plotting, - check it works first with a standard PDF plot maybe? then change to what you want. I have a little function for each pdf setting - below they are just values but would be things like client specific stuff, company styles and so on, then these are set to variables which is what most of this is. Look through for 'Change this bit here' as what to change for your PDFs. Note that there are 2 PDF plotters set, I use one to do a plot preview and one that doesn't - you'll need to change both to your Foxit plotter. Anyway, if this works for you it is a basis to do all the other stuff that you might want - just go to each sub function to adjust as you need. (defun c:pdfplot ( / ) ;; NOTE: Variables not set ;; Sub functions (defun PDFgetdetailedplotconfiguration ( / dpc) (setq dpc "Yes") dpc) (defun PDFgetlayoutname ( / lname) (setq lname (getvar "ctab")) lname ) ;;;;;;;;;;;;;;;;;;;;;; ;;Change this bit here (defun PC3Name ( / ) "DWG to PDF.pc3" ) ; plotter setting with preview ;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;; ;;Change this bit here (defun PC3NameNP ( / ) "DWG to PDF no Preview.pc3" ) ; No preview plotter setting ;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;; ;;Change this bit here (defun PDFgetpapersize ( / ) (setq papersize "ISO expand A0 (841.00 x 1189.00 MM)") ) ;;;;;;;;;;;;;;;;;;;;;; (defun PDFgetpaperunits ( / pu) (setq pu "") pu) (defun PDFGetPageOrientation ( / ) (setq pageorientation "L") pageorientation) (defun PDFgetorientation ( / orientation) (setq orientation "landscape") orientation) (defun PDFgetplotupsidedown ( / plud) (setq plud "N") plud) (defun PDFgetplotarea ( / pla) (setq pla "Extents") pla) ;;Extents, Display, Limits, View (defun PDFgetplotscale ( / pls) (setq pls "Fit") pls) (defun PDFgetplotoffset ( / plo) (setq plo "Center") plo) (defun PDFgetplotwithplotstyles ( / plwpls) (setq plwpls "Y") plwpls) ;;;;;;;;;;;;;;;;;;;;;; ;;Change this bit here (defun PDFgetplotstyletablename ( / plstname) (setq plstname "acad.ctb") plstname) ;;;;;;;;;;;;;;;;;;;;;; (defun PDFgetplotwithlineweights ( / plwlw) (setq plwlw "Y") plwlw) (defun PDFgetshadeplotsetting ( / spls) (setq spls "As Displayed") spls ) (defun PDFgetfullpath ( / fp) (if (= (getvar 'dwgtitled) 1)(setq fp (getvar "dwgprefix"))) ;;drawing saved (if (= (getvar 'dwgtitled) 0)(setq fp (strcat (PDFgetDesktop) "\\"))) ;;drawing not saved fp ) (defun PDFgetDesktop ( / script spFolders desktop) ;;gets the location of the desktop (cond ( (setq script (vlax-create-object "WScript.Shell")) (setq spFolders (vlax-get-property script "SpecialFolders") desktop (vlax-invoke-method spFolders 'Item "Desktop") ) (vlax-release-object spFolders) (vlax-release-object script) )) desktop ) (defun PDFgetfilename ( / myfnloc myfn myf) ;; check in here if PDF file to write to is open (setq myfnloc (PDFgetfullpath)) (setq myfn (vl-filename-base (getvar 'dwgname))) (setq myf (strcat myfnloc myfn ".pdf")) myfn ) (defun PDFgetsaveplotsettings ( / savepls) (setq savepls "N") savepls ) (defun PDFgetproceedwithplot ( / pwpl) (setq pwpl "Y") pwpl ) (defun PDFgetplottername ( pdfpreview / pname) ;;;;pname this needs to be set up in pagesetup settings ;;;; ;;;;;;;;;;;;;;;;;;;;;; ;;Change this bit here (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") ;; plotter setting with no preview (if (findfile (setq PC3FilePath (strcat (PC3Loc) "\\" (PC3NameNP))) ) (setq pname (PC3NameNP)) );;end if );;end if pname ) ;;End of sub functions (setq detailedplotconfiguration (PDFgetdetailedplotconfiguration)) (setq layoutname (PDFgetlayoutname)) (setq pdfpreview "N") (setq plottername (PDFgetplottername pdfpreview)) (setq papersize (PDFgetpapersize)) ;;drawing paper size...not plotting size if different (setq paperunits (PDFgetpaperunits)) (setq orientation (PDFgetorientation)) (setq plotupsidedown (PDFgetplotupsidedown)) (setq plotarea (PDFgetplotarea)) (setq plotscale (PDFgetplotscale)) (setq plotoffset (PDFgetplotoffset)) (setq plotwithplotstyles (PDFgetplotwithplotstyles)) (setq plotstyletablename (PDFgetplotstyletablename)) (setq plotwithlineweights (PDFgetplotwithlineweights)) (setq shadeplotsetting (PDFgetshadeplotsetting)) (setq fullpath (PDFgetfullpath)) (setq myfilename (PDFgetfilename)) (setq filepathname (strcat fullpath myfilename ".pdf")) (setq saveplotsettings (PDFgetsaveplotsettings)) (setq proceedwithplot (PDFgetproceedwithplot)) ;; Do plotting ;;Plot model space (if (= (getvar "TILEMODE") 1) ;;model space plot (progn (if (= (ssget "_x" '((410 . "Model"))) nil) ;;check if there are any objects to plot (progn (alert "-CANCELLING-\nThe drawing is blank") (exit) ) ; end progn ) ; end if (if (= plotarea "window") (command "-plot" detailedplotconfiguration layoutname plottername papersize paperunits orientation plotupsidedown plotarea pause pause plotscale plotoffset plotwithplotstyles plotstyletablename plotwithlineweights shadeplotsetting filepathname saveplotsettings proceedwithplot) ) ; end if 'window' (if (/= plotarea "window") (command "-plot" detailedplotconfiguration layoutname plottername papersize paperunits orientation plotupsidedown plotarea plotscale plotoffset plotwithplotstyles plotstyletablename plotwithlineweights shadeplotsetting filepathname saveplotsettings proceedwithplot) ) ; end if ) ; end progn ) ; end if modelspace ;;Plot paper space (if (= (getvar "TILEMODE") 0) (progn (if (= plotarea "window") (command "-plot" detailedplotconfiguration layoutname plottername papersize paperunits orientation plotupsidedown plotarea pause pause plotscale plotoffset plotwithplotstyles plotstyletablename plotwithlineweights "" "" "" filepathname saveplotsettings proceedwithplot) ) (if (= plotarea "extents") (command "zoom" "all" "zoom" ".95x") ;; Zoom screen, just because (command "-plot" detailedplotconfiguration layoutname plottername papersize paperunits orientation plotupsidedown plotarea plotscale plotoffset plotwithplotstyles plotstyletablename plotwithlineweights "" "" "" filepathname saveplotsettings proceedwithplot) ) ; end if ) ; end progn ) ; end if paperspace (princ) ; exit quietly )
    1 point
  3. Use the DCL tabs attribute and prefix the list items with a tab character ("\t").
    1 point
  4. I have used just a lisp name not a path in the autoload. All our customisation was in one directory on a server, it did though have sub directory's lisp blocks icons etc. Yes if you have Acad need to add trusted paths. (if (> (vl-string-search "BRICSCAD" (strcase (getvar 'product))) 0) (princ "Bricscad not found") (progn (setq oldtrust (getvar 'trustedpaths)) (if (wcmatch oldtrust "*XXX*") (princ) (setvar 'trustedpaths (strcat oldtrust ";" "c:\\XXX-CAD-TOOLS")) ) ) ) (command "workspace" "save" "" "y") ; a good idea is have a new workspace say user name (alert "\nSupport and trusted paths added")
    1 point
  5. Hi Indeed, any process started from AutoCAD will inherit its privilege level. For example, if AutoCAD opens an instance of Word, that instance will inherit the same privilege level as AutoCAD. However, if a Word instance is already running and AutoCAD starts controlling it, its privilege level might be different. In that case, it might be necessary to check it in order to warn the user. Could your issue be something similar to that? As @mhupp says, there is no direct way to determine this from VLisp. But there are some tricks to achieve it: For example: (defun acadAdmin? (/ arch r ruta ruta1 f sh) (if (findfile (setq ruta1 (strcat (getenv "TEMP") "\\acAdmin.si"))) (vl-file-delete ruta1) ) (if (setq arch (open (setq ruta (strcat (getenv "TEMP") "\\ea.bat")) "w")) (progn (write-line "@echo off net session >nul 2>&1 if %errorlevel% == 0 ( echo SI> \"%temp%\\acAdmin.si\" )" arch ) (close arch) (setq sh (vlax-create-object "WScript.Shell")) (vlax-invoke sh 'Run ruta 0 :vlax-true) (vlax-release-object sh) (vl-file-delete ruta) (if (setq r (findfile ruta1)) (progn (vl-file-delete ruta1) T ) ) ) ) ) This simply writes a .bat that when executed, creates the file "acAdmin.si" only if AutoCAD is running as admin
    1 point
×
×
  • Create New...