All Activity
- Past hour
-
Moving objects within polyline to different layer
mhupp replied to Hsanon's topic in AutoLISP, Visual LISP & DCL
Might want to take those down and only upload a "Sample" drawing that doesn't have a title block with addresses and names or map. -
proa joined the community
- Today
-
alanjt started following Curb offset
-
See attached. It does not set layers, but I use this to generate curb offsets, based on multiple selected lines/etc. OffsetMultiple.lsp
-
caduvil joined the community
-
Moving objects within polyline to different layer
Hsanon replied to Hsanon's topic in AutoLISP, Visual LISP & DCL
apologies for the delayed response..... Can you try out the program on these files???? It works just fine on a new file made up of simple oblects... but just doesn't work on typical files on which i have to work further. Some times, it works on part of the objects.... (some objects get converted to "exist" layer and some dont) Are there some objects the survey drawing has which are causing the program to mess up ??? Just last try.... otherwise ill get back to my painstaking manual changes. Many many thanks ganges Sugam Survey with Tree details 14.8.25.dwg JC 6 ROYED ST-Basu survey.dwg -
devitg started following Cross Section area and Its calculation and REACTOR Exposure Request
-
@ScottMC Please upload your SAMPLE.dwg and Sample.lsp as to see what you did and want to do
-
You can install the UKIE package and it has a built-in function to export and import styles. https://www.autodesk.com/sites/default/files/file_downloads/UKIE User Guide and Reference.pdf The Civil3D UKIE package is after 2023 or 2024 can be found in the AutoDesk Product page under Civil3d.
-
Penn Foster Student Suffering with Oleson Village Map!!!
ReMark replied to AutoCad Student's topic in Student Project Questions
You're right, there is no mention of a layer that makes use of the dashed linetype in this project. I suggest you create a layer called "Arc", layer color "white" and assign it the "Dashed" linetype. There are only four overall (boundary) dimensions that will require manually created arcs. As for the title block and border draw it per the instructions. When completed use the Scale command to scale it up. The scale factor should be 50. -
SHU joined the community
-
Cross Section area and Its calculation
SLW210 replied to ..very.'s topic in AutoLISP, Visual LISP & DCL
Your profile does not show what CAD software you are using. Yes, you need to post a drawing, preferably showing a before and after. -
Steven P started following Cross Section area and Its calculation
-
Cross Section area and Its calculation
Steven P replied to ..very.'s topic in AutoLISP, Visual LISP & DCL
Have you got a sample drawing which might show bit more detail? should be possible though - simplest if you have the cross section drawn out is hatch, use properties to get the hatch area. I suspect it will be more complex than that -
Penn Foster Student Suffering with Oleson Village Map!!!
Val replied to AutoCad Student's topic in Student Project Questions
Hello, I'm at the final steps for this project and I'm stuck on 2 parts. First is the dimensioning the total length of the lot sides added together. It says to use a dashed line for the arc and line, but the list of layers never mentions a layer that uses dashed lines. Is this some sort of annotation setup that I'm overlooking? And is there a command for the having the ends of the dimension being arcs, or do I need to make those manually? Second part is the setup for the border. I understand it's a 24 x 36 and that 1 unit equals 1 foot and that I will need to scale it up once created. But then they throw in the line that the actual input is 2 x 3 and I'll have to figure out the math. This is throwing me for a loop, or possibly my brain has just turned to mush from overthinking it. Thanks in Advance for the help. -
Val joined the community
-
Really enjoy what y'all have done with reactors but have yet to see a live circle using edge tangents. Has this been used in Civil/Mech? Might inspire me to learn a little.. Thanks
- Yesterday
-
GMboxSMG2 joined the community -
I’ve been experimenting with @lrm's tool to generate segment-by-segment bisectors. In many cases I was able to chain them together without any issues, and the equidistance was achieved. But in the more curved areas, the bisectors produced by each pair of segments lead to results that make it impossible to connect them without losing that equidistance. So I must apologize for my excessive optimism I guess the goal can only be to achieve true equidistance wherever it’s geometrically possible, and where it isn’t, to get the smallest deviation we can. In the attached images you can see in red the result of using Irm’s tool segment by segment and manually joining the endpoints. The result is an equidistant centerline along most of the path. But as you can see in the area where the margins widen significantly, the geometry of the axis becomes very fuzzy. Alongside my manual work with Irm’s tool, you can also see the output from commands "CPL" by @GP_ and "cl" by @dexus/@marko_ribar. In fact, "cl" produces something very close to a true equidistant centerline, although it can be a bit irregular at times. And I suppose the issue with redundant points can be solved easily. So it seems that the solution by Dexus/Ribar is the best one so far.
-
..very. joined the community
-
Hello, I need to find net cross section area of river after proposing design section. Also i need a detailed calculation (like 1/2 x length x width) written below every section. Is it possible using LISP command??
-
dandeeh joined the community
-
here's the 'BIGAL DCL version.. (defun c:trpz ;; https://www.cadtutor.net/forum/topic/98827-the-coordinates-of-the-trapezoid/ (/ *error* ang radian pt1 pt2 pt3 pt4) (princ "\n Trapezoid from Lower.Left..") (defun *error* ( msg ) (setvar 'cmdecho 0) ;; 5.28.24 (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (if msg (prompt (strcat "\n" msg))) (setvar 'cmdecho 1) (princ "\n") (princ) ) (if (not AH:getvalsm) (load "Multi Getvals.lsp") ) ;_ end of if (setvar 'cmdecho 0) (setq ans (AH:getvalsm (list "Enter Values" ;; title "Base Width " 5 4 "10" "Height " 5 4 "10" "Angle" 5 4 "30" ) ;_ end of list ) ;_ end of AH:getvalsm ) ;_ end of setq (setq Wid (atof (nth 0 ans)) ht (atof (nth 1 ans)) ang (atof (nth 2 ans)) ) ;_ end of setq (if (= ang 90)(c:trpz)) ;; restart if ang 90.. etc (setq radian (* pi (/ ang 180.0))) ;; Determining the starting point (setq pt1 (mapcar (function +) (list 0.0 0.0) (getpoint "\r Specify the Lower.Left Basepoint: ") ;; \r overrights values from Multi.. ) ;_ end of mapcar ) ;_ end of setq ;; Calculating the coordinates of the vertices of a trapezoid (setq pt2 (polar pt1 0.0 wid)) (setq pt3 (polar pt2 (- (* 0.5 pi) radian) (/ ht (cos radian)))) (setq pt4 (polar pt1 (+ (* 0.5 pi) radian) (/ ht (cos radian)))) ;; Drawing a trapezoid (command "_.pline" "_non" pt1 "_non" pt2 "_non" pt3 "_non" pt4 "_C") ;_ end of command (setvar 'cmdecho 1) (*error* nil) (princ) ) ;_ end of defun
-
dnenad started following Solidworks VBA for renaming components in an assembly
-
This macro works in Solidworks 2024. Would someone please help me to get it working properly for 2025? See attached file. Thanks. jn_2.txt
-
Or just (/ pi 6)
-
dnenad joined the community
-
kyle zumwalt joined the community
- Last week
-
Diego_74 joined the community
-
Here is another version of the code ;; Draw of a trapezoid based on the lower base, height and angle of the lateral lines ;; insertion beyond the lower left point of the base line (defun c:DrawTrapWHAng (/ baseWidth height ang radian dx pt1 pt2 pt3 pt4) (setq baseWidth (getreal "Enter the size of the bottom base: ")) (setq height (getreal "Enter the height of the trapezoid: ")) ;; The angle between the vertical and the lateral side (in degrees) ; (setq ang 30.0) ; The angle is set to 30 ;; You can set any angle manually (in degrees) (setq ang (getreal "Enter the angle between the vertical and the side (in degrees): ")) ;; Converting the angle to radians ;; If you need a fixed angle of 30 degrees (or other), delete the ";" in front of one of the lines below. ; (setq radian (* ang (/ pi 180.0))) ; (setq radian (* (/ 1.0 6.0) pi)) ; or *advice from BIGAL ; (setq radian (/ pi 6)) ; or *advice from Lee Mac (setq dx (* height (/ (sin radian) (cos radian)))) ;; The starting point of the lower base (bottom left) (setq pt1 (getpoint "Specify the starting point of the lower base: ")) ;; Lower right point (setq pt2 (list (+ (car pt1) baseWidth) (cadr pt1))) ;; Upper right point – move outward to the right (setq pt3 (list (+ (car pt1) baseWidth dx) (+ (cadr pt1) height))) ;; Upper left point – move outward to the left (setq pt4 (list (- (car pt1) dx) (+ (cadr pt1) height))) ;; Drawing a trapezoid (command "_.pline" pt1 pt2 pt3 pt4 "_C") (princ) )
-
I now have tried a few methods, they all miss the center somewhere on the complicated "turns". As I mentioned, even the GIS/Civil programs get similar results at times. I did rabbit hole Bowyer–Watson algorithm and the Delaunay triangulation to obtain a Voronoi diagram of the points. That might be over my head for LISP, I think I have seen references for Python and C# though. I had decent results with my export to CSV and import a center line back, though still has an off center place or two on the OPs example.
-
If you want 30 degree use (* (/ 1.0 6.0) pi) My $0.05 the front end can preset values but change as required. (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq ans (AH:getvalsm (list "Enter Values" "Base Width " 5 4 "100" "Height " 5 4 "100" "Angle" 5 4 "30" ))) (setq Wid (atof (nth 0 ans)) ht (atof (nth 1 ans)) ang (atof (nth 2 ans))) (setq ang (* pi (/ ang 180.0))) Multi GETVALS.lsp
-
oliverbonas72 started following Marketing your architecture/drafting services?
-
Lee Mac started following The coordinates of the trapezoid
-
Another for fun - should work in all UCS/Views: (defun c:itsatrap ( / hgt len ocs off pt1 pt2 ) (if (and (setq pt1 (getpoint "\nInsertion point: ")) (setq len (getdist "\nLength of base: " pt1)) (setq hgt (getdist "\nHeight: " pt1)) (setq ocs (trans '(0 0 1) 1 0 t) pt2 (cons (+ (car pt1) len) (cdr pt1)) off (* hgt (/ (sqrt 3) 3)) ) ) (entmake (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 4) '(70 . 1) (cons 10 (trans pt1 1 ocs)) (cons 10 (trans pt2 1 ocs)) (cons 10 (trans (list (+ (car pt2) off) (+ (cadr pt2) hgt) (caddr pt2)) 1 ocs)) (cons 10 (trans (list (- (car pt1) off) (+ (cadr pt1) hgt) (caddr pt1)) 1 ocs)) (cons 210 ocs) ) ) ) (princ) )
-
@mhupp No problem my friend. I agree wholeheartedly that it's good to show alternative ways to do the code - helps folks to learn the way it works. Cheers
-
I was just showing a different way to do things. In AutoCAD do whatever your comfortable with. Yes with simple code you will never see a difference in time.
-
@Nikon IMHO - the extra variables that mhupp referenced in his example are unnecessary, and you didn't localize them. I'd recommend you simplify to this: (defun c:trapezoid (/ bw p0 p1 p2 p3 p4 ra sa th) (if (and (setq bw (getreal "\nEnter the width of the Base: ")) (setq th (getreal "\nEnter the Height: ")) (setq sa (getreal "\nEnter the side angles: ")) (setq p0 (getpoint "\nSelect the insertion point: ")) ) (progn (setq ra (* pi (/ sa 180.0)) p1 (list (- (car p0) (/ bw 2)) (cadr p0) (caddr p0)) p2 (list (+ (car p1) bw) (cadr p0) (caddr p0)) p3 (list (+ (car p2) (* (/ th (cos ra)) (sin ra))) (+ (cadr p0) th) (caddr p0)) p4 (list (- (car p1) (* (/ th (cos ra)) (sin ra))) (+ (cadr p0) th) (caddr p0)) ) (entmakex (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 4) '(70 . 1)) (mapcar '(lambda (x) (cons 10 x)) (list p1 p2 p3 p4)) ) ) ) ) )
-
@mhupp that works fine. I personally think the benefits are extremely tiny on such a simple code form. For short routines, I tend to just use the command sequence. On more intensive stuff I use the ActiveX entity creation more often then using entmake with DXF codes.
-
I replaced in the code @pkenewell (command-s "._pline" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "_c") with (entmakex… It works too. ;; pkenewell 14.11.2025 (defun c:trapezoid-pk-mh (/ bw p0 p1 p2 p3 p4 ra sa th) (if (and (setq bw (getreal "\nEnter the width of the Base: ")) (setq th (getreal "\nEnter the Height: ")) (setq sa (getreal "\nEnter the side angles: ")) (setq p0 (getpoint "\nSelect the insertion point: ")) ) (progn (setq ra (* pi (/ sa 180.0)) p1 (list (- (car p0) (/ bw 2)) (cadr p0) (caddr p0)) p2 (list (+ (car p1) bw) (cadr p0) (caddr p0)) p3 (list (+ (car p2) (* (/ th (cos ra)) (sin ra))) (+ (cadr p0) th) (caddr p0)) p4 (list (- (car p1) (* (/ th (cos ra)) (sin ra))) (+ (cadr p0) th) (caddr p0)) ) ; (command-s "._pline" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "_c") ; pkenewell (setq pts (list p1 p2 p3 p4)) ; mhupp (setq trap (entmakex (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 4) '(70 . 1)) (mapcar '(lambda (p) (cons 10 p)) pts) ) ) ) ) ) (princ) )
-
Steven P started following The coordinates of the trapezoid
-
and entmake isn't affected by snaps in case you forget to bypass them as necessary. Far better I think - It is all I ever do when creating entities
