All Activity
- Yesterday
-
@PGia "where AutoCAD controls an already running instance of Access" You should be able to use get application, this is for Excel. Try this line with Access. The code works with Word and I am pretty sure works with Access. Have your access open when running the code. ;; Try to get or create Excel instance (setq myxl (vl-catch-all-apply 'vlax-get-or-create-object '("Excel.Application"))) Did you do a Google "read and write to Access Autolisp". Pretty sure its similar to Excel uses row and columns. I can provide read write for Excel which should work with Access. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-data-from-an-access-database/td-p/6238062
-
This task is posted over at Autodek forums as well https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/custom-pc3-not-supported/td-p/13710861 Some answers re set page sheet details were provided.
-
Forward Visibility Lisp - DXF issue
BIGAL replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
@SLW210 " extra time to make something." it is actually easy to work out a line from two points along say a pline, you just start with a point on the pline. and then draw an arc forward the radius = length of the line , using intersectwith you get the forward point, so just join the 2 points. @CivilTechSource need more info a dwg etc. Drive along a path uses a short arc length. -
I use the technique frequently to achieve list box columns - for example, as used by the Content Builder dialog displayed by my Incremental Numbering Suite.
-
Hi, Sorry for not replying earlier. I've been traveling for several days. @BlackBox: I don't understand what's so special about implementing a Lisp function that returns the privileges with which another application, controlled by AutoCAD, was launched. Do you need my code? Here it is: (setq Access (vl-catch-all-apply 'vlax-get-object '("Access.Application"))) (if (vl-catch-all-error-p accApp) (progn (setq privileges (adminP "acad")) (setq msg (strcat "\nThere is no current instance of Access\nA new one will open with the same privileges as AutoCAD: " privileges)) (alert msg) (setq Access (vl-catch-all-apply 'vlax-create-object '("Access.Application"))) (if (vl-catch-all-error-p Access) (princ "\nIt was not possible to open a new instance of Access") (progn (vlax-put-property Access 'Visible :vlax-true) (princ "\nConnection successful") ) ) ) (progn (setq privileges (adminP "access")) (setq msg (strcat "\nAn instance of Microsoft Access was found with the folowing privileges: " privileges "\nConnection successful")) (alert msg) ) ) Where adminP is the function I need. It's something I found somewhere and I'm trying to adapt it to my needs. This code will be used on 3 PCs. Currently, in all cases, AutoCAD is configured to start as Administrator. Therefore, any application launched from AutoCAD should inherit the same privileges, as far as I understand. However, I would also like to cover the case where AutoCAD controls an already running instance of Access, as you mentioned. So I tried to add something to the code to take that possibility into account. Would it be possible to modify this Lisp code to return the privileges of any existing Access instance?
-
BlackBox started following custom .pc3 not supported
-
Given how long ago the Autopublish mechanism was introduced, I'm surprised it's not being used more. Autopublish uses the Page Setup you've assigned to Layout, to automagically produce PDF when you save DWG. To plot a full plan set, PUBLISH is frequently used, but it plots the entire set one-at-a-time in series, which takes entirely too long. Autopublish also works in Core Console... which allows you to effectively plot all DWG files at the same time in parallel. As example: If it takes 30 seconds to PUBLISH a single-Layout drawing, it takes the same amount of time to plot all drawings in the set, and you have 50 drawings, PUBLISH might take +/-25 minutes to produce PDF. With Core Console it only takes less than 1 minute to plot the same plan set (Note: your workstation's system resources and single vs multi-layout drawings determine how long it takes, multiple single-layout drawings take less time to plot, than fewer multi-layout drawings). Here's a sample .REG file to create the Windows Shell Menu, so you can plot DWG-->PDF from File Explorer (I use Civil 3D): Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\RightClickDwgToPdf] @="2026 DWG to PDF" "AppliesTo"=".dwg" ; "Icon"="C:\\Program Files\\Autodesk\\AutoCAD 2026\\accoreconsole.exe" "HasLUAShield"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\*\shell\RightClickDwgToPdf\command] @="\"C:\\Program Files\\Autodesk\\AutoCAD 2026\\accoreconsole.exe\" /i \"%1\" /ld \"C:\\Program Files\\Autodesk\\AutoCAD 2026\\AecBase.dbx\" /p \"<YourProfileHere>\" /product \"C3D\" /language \"en-US\" /s \"C:\\<YourFilePathHere>\\RightClickDwgToPdf.scr\"" Here's the dependent Script: ;; reload layer state, set other sysvars (setvar 'automaticpub 1) (command ".QSAVE") That's it; this little bit of code is all that's needed. HTH
-
@Steven P For sure I'm try this and let you know and thank you so much...
-
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 )
-
I didn't know you could do that! Still need to add the tabs \t to the base list, but you'd get a better result I think
-
Lee Mac started following Gap Dcl in Block list
-
Use the DCL tabs attribute and prefix the list items with a tab character ("\t").
-
I tried that also it doesn't give any difference @Steven P
-
Looking at this one, if I substitute "DWG to PDF.PC3" instead of your Foxit plotter, your PDF1 code will recognise the plotter, so might be an error in the name or if it is saved in the correct location. Does it do anything if you use one of the default CAD PDF writers rather than 3rd party PDF?
-
Steven P started following Gap Dcl in Block list
-
One way, might be the easiest is to change the list that populates 'Block List', adding spaces to the nested block So you might have a line like this in your LISP: (start_list "lst" 3)(mapcar 'add_list BlockList)(end_list) Where BlockList is your list of block, might be (setq BlockList (list "BLOCK-1" "BLK-1" "BLK-2"... "BLOCK-2")) Which you could change to be (setq BlockList (list "BLOCK-1" " BLK-1" " BLK-2"... "BLOCK-2")) I don't think you can do the indenting with DCL, has to be done before then.
-
sachindkini started following Gap Dcl in Block list
-
Hi Sir, how to gap betwwen main block and nested block in dcl ;----------------------------------------------- (cond ((null (setq lst (vl-sort lst '<))) (princ "\nNo blocks found in drawing.") ) ((null (and (setq tmp (vl-filename-mktemp nil nil ".dcl")) (setq des (open tmp "w")) (foreach line (list (strcat "blockpreview : dialog { label = \"" datetitle "\";") ;; Title with date-time " spacer;" " : row {" " : boxed_column { label = \"Block List\"; width = 35; fixed_width = true;" " : list_box { key = \"lst\"; height = 15; fixed_height = true; }" " }" " spacer;" " : boxed_column { label = \"Preview\"; width = 35; fixed_width = true;" " : image { key = \"img\"; height = 15; fixed_height = true; }" " }" " }" " spacer;" " : image { color = 30; width = 50; height = 0.5; alignment = centered; }" ;; Orange line " spacer;" " : boxed_column { label = \"Block Tools\";" ;; Single box around ALL buttons " : row {" " : button { key = \"cbp_btn\"; label = \"Change Base Point\"; }" " : button { key = \"cbpr_btn\"; label = \"Change Base Point (Ref)\"; }" " }" " spacer;" " : row {" " : button { key = \"rename_btn\"; label = \"Rename\"; is_default = true; }" " : button { key = \"select_btn\"; label = \"Select Block\"; }" " : button { key = \"cancel\"; label = \"Cancel\"; is_cancel = true; }" " : button { key = \"about\"; label = \"About\"; }" " }" " }" " spacer;" " : text { label = \"Author: XYZ | https://abcd.com/\"; alignment = centered; }" "}" ) (write-line line des) ) (not (setq des (close des))) (< 0 (setq dcl (load_dialog tmp))) (new_dialog "blockpreview" dcl) ) ) (princ "\nUnable to load dialog.") ) ;------------------------------------------------
-
Tapered Offset/Stretch closed polyline shape
pkenewell replied to SLW210's topic in AutoLISP, Visual LISP & DCL
I've played with ElpanoxEvgeniy's original code and made a working version. It;s fine on straight segments but can be a little unpredictable on curved segments @GLAVCVS code is a bit more stable on curved segments. -
Tapered Offset/Stretch closed polyline shape
dexus replied to SLW210's topic in AutoLISP, Visual LISP & DCL
Has anyone tried the code, got it working and find it useful? -
Forward Visibility Lisp - DXF issue
SLW210 replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
Nice video. The OP could use civil site design, is it better than the one in Civil 3D? Autodesk Civil 3D Help | To Calculate Sight Distance Along a Corridor | Autodesk Help | To analyze sight distance | Autodesk for InfraWorks. I know about about forward visibility, the question was... I would surmise there are objects to select as a reference. The LISP has "Select Polyline" but shows... (cons 0 "*POLYLINE,ARC,SPLINE") Also would like to know why the OP thought the original was not drawing the lines correct. I am back at my work computer, so I might do a little more checking, though without a real drawing from the OP, I will be guessing or have to take extra time to make something. Maybe this LISP works better... Lisp routine to show visibilty splays Or... Maximum Stopping Sight Distance Lisp - AutoLISP, Visual LISP & DCL - AutoCAD Forums -
when i try to run it on a multileader it says: ActiveX Server returned an error: Parameter not optional
-
Forward Visibility Lisp - DXF issue
BIGAL replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
If I understand correctly the idea is to check a drivers visibility by producing a set of plines and then you can visibly check does it touch something. have a look at this -
How to deploy list of Lisps to everyone in the organisation - AutoCAD LT
BIGAL replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
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") - Last week
-
Forward Visibility Lisp - DXF issue
SLW210 replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
I use this for layer 0 at the end of a LISP. (command "_.LAYER" "_Set" "0" "") Error: Bad DXF group: (10) means that the application has attempted to create an entity with wrong vertices (a polyline with a single vertex, identical endpoints for a line, etc.). https://www.cadforum.cz/en/error-bad-dxf-group-10-tip9081 I think you could be passing 2D points when a 3D points are expected, but I won't be able to take a better look until Monday sometime. Most likely in the... ;----- Function to create Forward Visibility Polylines P.S. Just for the record, what exactly is this LISP supposed to do? Can you post an example drawing? P.S.S. Do you have a link or a copy of the original LISP? -
How to deploy list of Lisps to everyone in the organisation - AutoCAD LT
Steven P replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
I've never used that BigAl, do the LISP files need to be in trusted locations or is there a setting to specify your own folders maybe a network drive or similar? -
Hamood joined the community
-
karl.sch joined the community
-
KD-Trees are amazingly powerful, and most always overlooked because of their complexity to create and use. I’m always guilty of using brute-force tactics before forcing myself into using a better algorithm. Hopefully Point2dTree and Point3dTree will remove most of the complexities, make them more accessible The particular tree (nanoflann) is more geared towards point clouds, very fast. Should do 10^7 points in the blink of an eye
-
Forward Visibility Lisp - DXF issue
BIGAL replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
Ignoring the code for the moment, "Civil Site Design" has check site lines and it checks against the terrain model and the vertical alignment, not just a 2D answer. Looks at the drivers eye height and target height which is part of the check for us here in AUS. -
Very interesting, did something similar, I made a "where are they" map, it had a grid over the office floor so had a big staff list Bigal lev 5, A 1. I used the phone number as a link to an image of each staff member, so their picture appeared on their desk I simply saved each staff image as the extension number. It was reasonably fast making the new dwg inserting around 100 photo's per floor we worked in a 5 story building.