Leaderboard
Popular Content
Showing content with the highest reputation since 08/25/2026 in Posts
-
In another post there was questions about changing Mline styles for existing Mlines. So answered that and thought what about adding fillets to a mline. Wel as we know you can not do that, so did it this way. Converting the individual mlines to plines then filleting the plines produced. The fillet radius changing matching the offsets. ; Convert mline to plines and add a rdius. ; By AlanH Aug 2026 (defun LWPoly (lst cls) (entmakex (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length lst)) (cons 70 cls)) (mapcar (function (lambda (p) (cons 10 p))) lst))) ) (defun c:ml2plrad ( / oldsnap pt1 pt2 ent obj obj2 co-ords dict col lst x) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq pt1 (getpoint "\nPick 1st point for drag ")) (setq pt2 (getpoint pt1 "\nPick 2nd point ")) (setq pts (list pt1 pt2)) (setq ent (ssname (ssget "F" pts (list (cons 0 "Mline"))) 0)) (setq obj (vlax-ename->vla-object ent)) (setq styleName (vla-get-StyleName obj)) (setq lay (vlax-get obj 'layer)) (setvar 'clayer lay) (setq co-ords (vlax-get obj 'coordinates)) (vla-delete obj) (setq pts2 '() x 0) (repeat (/ (length co-ords) 3) (setq pts2 (cons (list (nth x co-ords)(nth (1+ x) co-ords)) pts2)) (setq x (+ x 3)) ) (setq dict (dictsearch (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))) styleName)) (setq offsets (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 49)) dict))) (setq col (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 62)) dict))) (setq col (cdr col)) ; ignore 1st color (setq lst '() x 0) (repeat (length col) (setq lst (cons (list (nth x offsets)(nth x col)) lst)) (setq x (1+ x)) ) (LWPoly pts2 0) (setvar 'filletrad (getreal "\nEnter Fillet radius for most outside offset ")) (command "fillet" "P" (entlast)) (setq x 1) (repeat (- (length col) 1) (setq obj2 (vlax-ename->vla-object (entlast))) (vlax-put obj2 'color (nth (1- x) col)) (vla-offset (vlax-ename->vla-object (entlast)) (- (nth x offsets)(nth (1- x) offsets))) (setq x (1+ x)) ) (setq obj2 (vlax-ename->vla-object (entlast))) (vlax-put obj2 'color (nth (1- x) col)) (setvar 'osmode oldsnap) (princ) ) (c:ml2plrad)3 points
-
2 points
-
As previously stated, used an install lisp, only a few minutes.2 points
-
There can be a lot more to it than that. "A closed boundary could not be determined" when creating a hatch in AutoCAD It actually says for one option- "Zoom out until all boundaries are visible. Then specify a new pick point", but I have actually had to zoom way in. "Valid hatch boundary not found." when adding Hatches in AutoCAD Products Also AutoCAD has an issue sometimes Select Object works, even though you should be able to use Pick points. This is about Boundary, but affects Hatches as well... Read the entire thread. Also, you can read this thread, though also boundary related. So basically the issue, besides the obvious gaps, elevations, et al, is summed up by @eldon1 point
-
I don't know if there was ever another LISP/Program to do this type of get length at least I never found one, my original just did what I needed, I have since made it more generally useful (I hope). As per the drawing I will attach, I just need to get the length of the center between the inner and outer of the perimeter of guards, etc. to determine the unrolled length. Normally the guards are 3D and I create the profiles with SOLPROF which creates an anonymous block (I used to change these with UNANON) or sometimes in the past I have used SOLVIEW and SOLDRAW, the same issue arises that you just can't select them and get the profile length. So originally that's what this LISP was created to do (I still have some of the older basic versions). I have upgraded it to it's current state and also still working on another version, but only small enhancements. For inside a block that is scaled, you will need to multiply the results by the scale factor, working through a viewport the viewport needs to be active, so I might tackle those issues as well as make a more detailed CSV. I also will try to make sure it works in non-AutoCAD like BricsCAD, CMS IntelliCAD, nanoCAD, etc. when I get time. I lightly tested in most situations, I have no idea how it acts on non-uniformly scaled blocks, though. It handles gaps and slight overlaps, I have some settings at the top, hopefully with enough instructions to modify on your own. Where I work (except for the machine shop which uses decimal inches) they use Architectural units, I did not double check this in Metric, so if someone would report back on that it would help. GetLenTest.dwg GetLen.lsp1 point
-
@SLW210 did a little bit of testing and works ok in Metric dwt. The only thing is the Architectural result. Limited Testing in Bricscad V25. made some shapes and inserted some blocks. A rectang 5000x4000 mm or decimal units. For metric don't need Architectural units. Curve length: 18000 Gaps: 0 Total: 18000 Architectural: 1500'-0" ?? For metric could do dwg is in mm but result is in metres to 3 decimals. You could use the Multi radio buttons.lsp to make choices. As its demand loaded you do not have to add it to your code. Re CSV your more than welcome to use the defuns in Alan Excel.lsp to write direct to Excel. Could demand load a lisp with just the defuns needed as don't need all that is in the lisp. Just a Ps a big file to screen copy maybe also post a file copy.1 point
-
I moved your thread to the AutoCAD 3D Modelling & Rendering Forum. Please start threads in the most appropriate forum.1 point
-
Google AI... (defun C:BBOX ( / ss index ent vlaObj minPt maxPt minExt maxExt pt1 pt2 ) (vl-load-com) (princ "\nSelect objects to enclose in a bounding box: ") ;; Prompt user to select objects (if (setq ss (ssget)) (progn (setq index 0) ;; Loop through all selected objects (repeat (sslength ss) (setq ent (ssname ss index)) (setq vlaObj (vlax-ename->vla-object ent)) ;; Safely catch objects that do not support a bounding box (if (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list vlaObj 'minPt 'maxPt)))) (progn (setq pt1 (vlax-safearray->list minPt) pt2 (vlax-safearray->list maxPt)) ;; Initialize or update the overall minimum and maximum coordinates (if (not minExt) (setq minExt pt1 maxExt pt2) (setq minExt (mapcar 'min pt1 minExt) maxExt (mapcar 'max pt2 maxExt)) ) ) ) (setq index (1+ index)) ) ;; Draw the bounding box if valid coordinates were collected (if (and minExt maxExt) (progn ;; Deactivate Object Snap temporarily to ensure precision (setq oldOsmode (getvar "OSMODE")) (setvar "OSMODE" 0) ;; Draw a standard rectangle using the global coordinates (command "_.rectangle" minExt maxExt) ;; Restore original Object Snap settings (setvar "OSMODE" oldOsmode) (princ "\nBounding box successfully created!") ) (princ "\nError: Could not calculate bounding box for selected objects.") ) ) (princ "\nNo objects selected.") ) (princ) ) (princ "\nType BBOX to run the command.") (princ)1 point
-
Provided you have made custom sheet sizes in the PLOT dialog. There is no reason why you can not have a title block or rectangle that is used to define the sheet size. Wether it be PDF or plot direct to roll plotter. Using layouts is best as the overall size will be at 1:1 eg 297x2010. Basically the custom size must exist, There was a post about making custom sheet sizes on the fly but very difficult to achieve. Me like a lot of others here can read the layouts and plot, there is plenty of examples of plot lisp's.1 point
-
Always use a company DWT and problem does not occur.1 point
-
YIL (yesterday I learned) there's a Python interpreter in ArcGIS. It's just a shell, but if you want to dip your toe in the water, it will let you run some code. When I have some time, I'll take it for a spin and report back.1 point
-
If it is going to a client I'll try to keep it all basic - no add ins, standard fonts, etc, if I can, on the assumption that their doc control will copy just the dwg file and all the rest will be lost to them at worst and at best when it is sent out again whoever sends it won't e-transmit, just the dwg, so we have to go round and round to get the rest.1 point
-
If you use Etransmit it will add extra files to what is exported, in particular say custom fonts and xrefs.1 point
