Leaderboard
Popular Content
Showing content with the highest reputation on 02/21/2025 in Posts
-
For VS Code... AutoCAD 2023 Developer and ObjectARX Help | Getting Started with Visual Studio Code (AutoLISP/VS Code) | Autodesk AutoCAD 2023 Developer and ObjectARX Help | Getting Started Videos (AutoLISP/VS Code) | Autodesk AutoCAD 2024 Developer and ObjectARX Help | To Download and Install VS Code (AutoLISP/VS Code) | Autodesk AutoCAD 2025 Developer and ObjectARX Help | Tutorial: Getting Started with the AutoLISP Extension (AutoLISP/VS Code) | Autodesk AutoLISP Has a New Home: Get to Know Visual Studio Code | Autodesk University2 points
-
Funny you should say that.... ZVPRect (Zoom ViewPort Rectangle) - click in viewport, ZVPRECT, select rectangle, exit viewport) ;;https://forums.autodesk.com/t5/autocad-forum/having-trouble-with-the-lisp-that-zooms-a-rectangle-that-fits-in/td-p/9378532 (defun c:zvprect ( / a b e o) (if (setq e (car (entsel "\nSelect Rectangle : "))) (progn (setq o (vlax-ename->vla-object e)) (vlax-invoke-method o 'GetBoundingBox 'a 'b) (setq a (vlax-safearray->list a) b (vlax-safearray->list b) ) (vl-cmdf "_.zoom" a b) ) ) (princ) ) Draw a rectangle round the parts to show their viewport area to make this work best, perhaps on an non-plotting layer in case the rectangle isn't the same proportions as the viewport1 point
-
Normally a Subdivision project where trees and other objects are inserted would be done by importing numbered points with descriptions using AutoCAD Civil 3D software. If that's what you're using your post should be in the Civil 3D & LDD forum https://www.cadtutor.net/forum/forum/45-civil-3d-amp-ldd/ If not there are other harder ways to do it. Let us know what software you have access to and if the Penn Foster tutorial mentions what software to use.1 point
-
Bonjour @anouar I understand that it is ok for you ? No need for working again on the question Amicalement1 point
-
Not at all Steven P.. I know how Help full CADTutot Has been to me.. I Really Appreciate the All the Great Contributors in this forum.. i was a member previously suryacad joined in 2016.. just joined back with a new id as is lost the old one... i appreciate every piece of advice on this forum.. i took my baby steps to lisp here and seeked a lot of help on this forum previously..1 point
-
i see what you were pointing at Danielm103.... the best i think is to mark the overlapping portions with points for now whit this code... Trying to Trace the Path of the Overlaping portion with a new polyline would be more like it... (defun c:MarkOverlap (/ ss plines layerName overlapLayer pline1 pline2 intPoints ptCount pt) ;; Prompt user to select polylines (setq ss (ssget '((0 . "LWPOLYLINE")))) (if (not ss) (progn (alert "No polylines selected. Exiting.") (exit) ) ) ;; Debugging: Print the number of polylines selected (princ (strcat "\nNumber of polylines selected: " (itoa (sslength ss)))) ;; Create a new layer for overlap points (setq layerName "OverlapPoints") (setq overlapLayer (tblsearch "LAYER" layerName)) (if (not overlapLayer) (progn (command "._-LAYER" "_M" layerName "_C" "1" layerName "") (princ (strcat "\nNew layer created: " layerName)) ) (princ (strcat "\nLayer already exists: " layerName)) ) ;; Set the new layer as current (setvar "CLAYER" layerName) (princ (strcat "\nCurrent layer set to: " layerName)) ;; Convert selection set to a list of polylines (setq plines '()) (setq index 0) (repeat (sslength ss) (setq pline (ssname ss index)) (setq plines (cons pline plines)) (setq index (1+ index)) ) (setq plines (reverse plines)) ;; Reverse to maintain original order (princ (strcat "\nNumber of polylines processed: " (itoa (length plines)))) ;; Initialize point counter (setq ptCount 0) ;; Iterate through all pairs of polylines (foreach pline1 plines (foreach pline2 plines (if (not (eq pline1 pline2)) (progn ;; Debugging: Print the handles of the polylines being compared (princ (strcat "\nComparing polyline 1 (Handle: " (vlax-get (vlax-ename->vla-object pline1) 'Handle) ")")) (princ (strcat "\nComparing polyline 2 (Handle: " (vlax-get (vlax-ename->vla-object pline2) 'Handle) ")")) ;; Find intersection points (setq intPoints (vlax-invoke (vlax-ename->vla-object pline1) 'IntersectWith (vlax-ename->vla-object pline2) acExtendNone)) (if intPoints (progn ;; Debugging: Print the number of intersection points found (princ (strcat "\nIntersection points found: " (itoa (/ (length intPoints) 3)))) ;; Process intersection points (setq i 0) (while (< i (length intPoints)) (setq pt (list (nth i intPoints) (nth (1+ i) intPoints) (nth (+ 2 i) intPoints))) (command "._POINT" pt) (setq ptCount (1+ ptCount)) ;; Increment point counter (setq i (+ i 3)) ;; Move to the next set of coordinates ) ) (princ "\nNo intersection points found.") ) ) ) ) ) ;; Debugging: Print the total number of points created (princ (strcat "\nTotal points created: " (itoa ptCount))) ;; Reset to the previous layer (setvar "CLAYER" (getvar "CLAYER")) (princ "\nOverlap locations marked with points on layer 'OverlapPoints'.") (princ) ) curve.dwg1 point
-
1 point
-
@Eric Devault If you look at the code, the block with the mark is created during the execution of the command itself, from a vertical line from point 0,0 and a length of 3 units. If you want to modify the length you can do so by changing 3.0 (in the second line of code of the 'creaBlq' function) to the number you need.1 point
-
i got it figured out, this is what it is for reference: this used our variables we created years ago. Thank you for your help. ^C^C._ZOOM;_E;_fillet;radius;0.0625;chamfera;0.0625;_chamferb;0.0625;dimasz;0.0625;dimcen;0;dimdli;0;dimexe;0.0625;dimexo;0.0625;dimgap;0.0625;dimtxt;0.1;donutid;0;donutod;0.5;gridunit;1,1;hpscale;0.25;hpspace;0.25;ltscale;0.208;offsetdist;1;snapunit;1,1;textsize;0.1;dimclrt;7;limits;0,0;36,24;dimscale;1;_chamfera;0.0625;chamferb;0.0625;dimasz;0.0625;dimcen;0;dimdli;0;dimexe;0.0625;dimexo;0.0625;dimgap;0.0625;dimtxt;0.1;donutid;0;donutod;0.5;gridunit;1,1;hpscale;0.25;hpspace;0.25;ltscale;0.208;offsetdist;1;snapunit;1,1;textsize;0.1;dimclrt;7;limits;0,0;36,24;getvar;dimscale;1;_QSAVE;$M=$(if,$(eq,$(getvar,DWGTITLED),0),~);._CLOSE;1 point
-
I think... (setq currentzoom (list (getvar 'viewctr) (getvar 'viewsize))) ;; List (centre of screen, View Size) And to return to that zoom: (vla-ZoomCenter (vlax-get-acad-object) (vlax-3d-point (car currentzoom)) (cadr currentzoom))1 point
-
"With the calculation of weight, it becomes more complicated." Fields can have formulas so you can get area and * weight.1 point
-
Bonjour @GLAVCVS Yes, it is the case, but the fields are only interesting when it is possible to modify the entity and therefore change the value of the field. With the calculation of weight, it becomes more complicated. So I made the choice to work with text and not with fields. Because regions are not entities that can be easily modified. I am waiting for the answer of @anouar He will say whether it is correct or not. Amicalement1 point
-
1 point
-
1 point
-
Bonjour @GLAVCVS I don't understand your message. Where is the "small" problem ? Have you read my solution? If this is the case, you understand that this line I correct is part of a general (setq) Amicalement1 point
-
1 point
-
Let's see. I don't quite understand what you need. Let me see if I get it right: do you need a few more lines of text where "Weight = [result of: (area * 2.7) / 1000]" appears?1 point
-
1 point
-
1 point
-
You can via lisp rearrange the layouts order, the only issue I see is if you have say like I did 88 layouts how you work out the order. This is one example. Moves current tab. (defun C:Mtab ( / lay num) (setq num (getint "\nEnter tab number")) (setq curtab (getvar "ctab")) (vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))) (if (= curtab (vla-get-name lay)) (vla-put-taborder lay num) ) ; if ) ; for (princ) ) ; defun (c:mtab) If there alphabetical etc you can reorder using a lisp. You could build a dcl list and some how rearrange the order, then update. I know if you have less than 20 can make a dcl with a number that you set.1 point
-
Has it ever worked? Any recent updates to AutoCAD and/or the OS? You might try creating a new profile. You may need to try a reset to defaults, repair or reinstall.1 point