All Activity
- Past hour
-
Understanding 'Getenv Variable call denied'?
pkenewell replied to ScottMC's topic in AutoLISP, Visual LISP & DCL
@ScottMC Ok - I think I understand. You want to the Circle to be the last entity created, even though you added the points. That is relatively simple, just delete the circle and recreate it. See the update to my code below. (defun c:C2 (/ cr el *error* fp oe os p p2) (defun *error* (msg) (if oe (setvar "cmdecho" oe)) (if os (setvar "osmode" os)) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (princ (strcat "\n" msg)) ) (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) (setq oe (getvar "cmdecho") os (getvar "osmode") ) (setvar "cmdecho" 0) (while (and (setvar 'osmode (boole 7 os 512)) (setq fp (getpoint "\nSpecify 1st Point of 2P.Circle: ")) ) (command "._Circle" "_2P" "_non" fp) (setvar "osmode" os) (princ "\nSecond Point: ") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (setq el (entget (entlast)) p (trans (cdr (assoc 10 el)) (cdr (assoc 210 el)) 1) p2 (getvar "lastpoint") cr (getvar "circlerad") ) (entdel (entlast)); Delete the Circle (princ (strcat "\n Coordinates: " (setq C2:pp ;; Global Variable "C2:pp" (strcat (rtos (car p) 2 4) "," (rtos (cadr p) 2 4) "," (rtos (caddr p) 2 4) ) ) "\n Diameter: " (rtos (* cr 2) 2 4) " | Radius: " (rtos cr 2 4) "\n" ) ) (entmakex (list (cons 0 "POINT") (cons 10 p))) (entmakex (list (cons 0 "POINT") (cons 10 p2))) (entmakex (list (cons 0 "CIRCLE") (assoc 10 el) (assoc 8 el) (assoc 40 el))) ; Recreate the Circle ) (setvar "cmdecho" oe) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (princ) ) -
How to copy an object to a specified distance
CyberAngel replied to sinergy2020's topic in AutoCAD Beginners' Area
The COPY command has several different schemes, but they all do the same thing. The difference is in how you input your information. One option is to type the command (COPY) before you select the objects. The prompt will say: Select objects: You pick the objects you want to copy and then continue with the command. If you've already selected them, you get this prompt: Specify base point or [Displacement mOde] <Displacement>: What happens next depends on your input. It's asking for a base point, that is, a place that marks the beginning of the operation. You can type a coordinate, like (2,5), or you can pick a point with your mouse. If you select a corner of your rectangle, for instance, that will help you place the copy in line with it, rather than doing some math. Another option is Displacement, which is probably better for your purposes. AutoCAD forgets about a base point. Instead hit Enter to go into Displacement mode. You type the distance, such as (5,0). The copy appears five units to the right, and you're done. If you do use a base point, you get this prompt: Specify second point or [Array] <use first point as displacement>: You can still use Displacement. AutoCAD assumes again that the base point is the beginning mark. When you put in the second coordinate, you've defined the distance between the original rectangle and the copy. If you work through all these versions of COPY, you see that they all give you similar results. The only difference is where the copy begins and ends, and that depends on how you enter those points. With a base point, you can start anywhere in your drawing. You can snap to a corner of your rectangle, for instance, or to any other object in the drawing. You can type in an X,Y coordinate based on anything, or type in numbers at random, or pick a random point with your mouse. Once you have that base point, you can pick a second point in the same way: a point on another object, a pair of numbers, or a point in space. Without a base point, AutoCAD assumes the base point is (0,0). Any X/Y distance you enter will be calculated from (0,0). The result is the same. The best way to learn any CAD system is to experiment. You can't break it by giving it bad input. Try the different options to see what they do. - Today
-
Steven P started following Understanding 'Getenv Variable call denied'? and [LISP] BPDF - Batch export Model Space title block frames to individual PDFs
-
[LISP] BPDF - Batch export Model Space title block frames to individual PDFs
Steven P replied to Beastt1992's topic in AutoLISP, Visual LISP & DCL
So post the LISP so we can give feedback - it is easier to reference if the LISP is in the same thread as the comments and questions Though I might be tempted to say change the system and get the draughters to use paperspace for what it is meant for. (haven't had the paperspace / modespace discussion on here for a while now....) -
Tule changed their profile photo -
huuhoai2012 joined the community
-
dusara joined the community
-
afaref joined the community
-
Beastt1992 joined the community
-
[LISP] BPDF - Batch export Model Space title block frames to individual PDFs
Beastt1992 posted a topic in AutoLISP, Visual LISP & DCL
Hi CADTutor, I'm an architect in Taiwan and wrote a free AutoLISP tool to solve a problem we face daily - batch exporting all title block frames in Model Space to individual PDFs. For those of us who work with all drawings arranged in one Model Space (common workflow in Taiwan/Asia), AutoCAD's built-in Batch Plot doesn't help much since it works at the Layout level. Features: - Click on a title block frame to detect the Block name automatically - Option to plot just that 1 frame, or all frames with the same name - Sorts output top-to-bottom, left-to-right - Dynamically loads plot styles and paper sizes from your machine - Remembers last settings - Compatible with AutoCAD 2014 and above GitHub: https://github.com/beastt1992/autocad-batch-plot Already tested by users on Reddit r/AutoCAD with good feedback. A couple of bugs were found and fixed based on community input (AC_WINDOW constant varies by version, RefreshPlotDeviceInfo order). Would love feedback from the AutoLISP community here - especially if anyone tests it on different AutoCAD versions or workflows! - Yesterday
-
Delfin joined the community
-
Civil Drafting with AutoCAD Project-Civil Drafting with AutoCAD Project
nelsonm replied to nelsonm's topic in Student Project Questions
Thank you for the answers! Now I understand it better -
Rodrigo ponce joined the community
-
Understanding 'Getenv Variable call denied'?
ScottMC replied to ScottMC's topic in AutoLISP, Visual LISP & DCL
As mentioned, my intention is to correct the 'post.create' entity selection to be the circle as last.object. The other reason is for me to have visibility of the 2p.circle as I draw it. Attchd is the latest working.. Circle-2P.lsp - Last week
-
Understanding 'Getenv Variable call denied'?
BIGAL replied to ScottMC's topic in AutoLISP, Visual LISP & DCL
You could save (entlast) properties like centre and radius so (setq cprop (list pt rad)) a line (setq Lprop (list start end)) you can redefine commands like circle as a lisp Defun so it would ask for pt and rad if it does not exist or use pt again for something else. Is that what your thinking ? -
Civil Drafting with AutoCAD Project-Civil Drafting with AutoCAD Project
BIGAL replied to nelsonm's topic in Student Project Questions
Where I am in Australia the co-ordinates of a real world point would be like X=473272.2831 Y=5977274.5924 Z=0 these values can be uploaded or read from survey data instruments. We just get used to working in big numbers. -
Did you try Recover, it checks a dwg, you choose the dwg to check.
-
Understanding 'Getenv Variable call denied'?
Steven P replied to ScottMC's topic in AutoLISP, Visual LISP & DCL
Not sure if this is something to look at and lamda / mapcar (car (mapcar '(lambda (a) (command "point" c) c) (setq c (getpoint "Get point")))) will return the point of the point... and somehow wrap that into a circle command.. though just a quick look it didn't work for me. Thinking something like: (command "circle" -lambda expression- -lambda expression-) So the points are created first and then the circle created last. Someone might know the workings to make that work. Have to use something like this to return a point as a part of another function -
BrandonJay joined the community
-
Kathleenor Donez joined the community
-
tombu started following Civil Drafting with AutoCAD Project-Civil Drafting with AutoCAD Project
-
Civil Drafting with AutoCAD Project-Civil Drafting with AutoCAD Project
tombu replied to nelsonm's topic in Student Project Questions
The X-coordinate is Easting the Y-coordinate is Northing and the Benchmark elevation is it's Z-coordinate used in Surveying as a reference for determining the elevation of other points. Topo surveys generally have Benchmarks labeled with their description and elevation. Generally at least 2 are required so they can be checked between and in case one of them is destroyed during construction activities. -
chris88 joined the community
-
Understanding 'Getenv Variable call denied'?
ScottMC replied to ScottMC's topic in AutoLISP, Visual LISP & DCL
re: I like it, while drawing, to 'pick what I've drawn with "L.ast" as I consider the circle the main entity created. In trying other order changes, really haven't found much better. The cmd-line coords are not in question are they? I prefer the coords that way for 'ease.of.use' on following commands. Suggestions, requests please. -
Civil Drafting with AutoCAD Project-Civil Drafting with AutoCAD Project
nelsonm replied to nelsonm's topic in Student Project Questions
I have another question, Drafting the Existing Site Plan (Sheet 1): It says this: "The area is in a state that bases all surveys on the intersection of a meridian and a baseline for that state. Therefore, the origin (or point 0, 0) for allsurveys is at that intersection, and any x- and y-coordinates tell the distance in feet from the intersection. If, for example, a benchmark is at point11675,39532, the benchmark is 2.21 miles east of the intersection and 7.49 miles north of the intersection. A benchmark (BM 312) exists at the northwest corner of the survey area. BM 312 has an elevation of 88.9 feet, and its coordinates are 521662,44895." Can someone explain this to me? -
What is the error message you are seeing?
-
How to copy an object to a specified distance
BIGAL replied to sinergy2020's topic in AutoCAD Beginners' Area
A couple of ways type copy, pick objects, pick start point, drag mouse, have say ortho on for in X & Y direction, type distance all done. These were written like 40 years ago. If you have this task a lot then Appload add to startup a lisp with code. (defun C:CHX () (SETVAR "CMDECHO" 0) (setq sn (getvar "osmode")) (command "osnap" "near") (princ "\nalters object in X direction") (setq ht (getstring "\n What is amount of change: ")) (setq newht (strcat ht ",0")) (while (setq newobj (entsel "\nPoint to object: ")) (command "move" newobj "" "0,0" newht) ) ) ; (defun C:CHY () (SETVAR "CMDECHO" 0) (setq sn (getvar "osmode")) (command "osnap" "near") (princ "alters object in Y direction") (setq ht (getstring "\n What is amount of change: ")) (setq newht (strcat "0," ht)) (while (SETQ NEWobj (entsel "\nPoint to object: ")) (command "move" newobj "" "0,0" newht) ) ) ;simple routine to change objects in the z direction (defun C:CHZ () (SETVAR "CMDECHO" 0) (setq sn (getvar "osmode")) (command "osnap" "near") (setq x 0) (princ "alters object in Z direction") (setq ht (getstring "\n What is amount of change: ")) (setq newht (strcat "0,0," ht)) (while (SETQ NEWobj (entsel "\nPoint to object: ")) (command "move" newobj "" "0,0,0" newht) ) ) -
For me I pop this, you can set Yes or No as default so press Ok or press enter (if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already (if (= but nil)(setq but 1)) ; this is needed to set default button (setq ans (ah:butts but "V" '("Mirror object" "Yes" "No" ))) ; ans holds the button picked value as a string Another is using ACET YesNo. Just google. Multi radio buttons.lsp
-
sinergy2020 started following How to copy an object to a specified distance
-
Hi, I am a beginner, and I am actually using nanocad, which seems to have very similar basic commands as Autocad. It basically looks so ... I'd like create a copy of an existing object, such as a rectangle, just beside the original one but at a specific distance. I am using the copy command which has a parameter for inputting a distance but I never manage to actually copy the new object exactly beside the exiting one at the specified distance. How is this done in Autocad?
-
rahul0007 joined the community
-
hi can anyone help me to fix the error in .dwg file.
-
mhupp started following Help: Insert block lisp
-
Solution?
-
leader and mtext are not attaching
pmadhwal7 replied to pmadhwal7's topic in AutoLISP, Visual LISP & DCL
-
Understanding 'Getenv Variable call denied'?
pkenewell replied to ScottMC's topic in AutoLISP, Visual LISP & DCL
@ScottMC Sorry, I don't understand what you are trying to convey. Please try to explain better what you mean, or make some screenshots of what your intended outcome is. -
Engenext changed their profile photo -
Understanding 'Getenv Variable call denied'?
ScottMC replied to ScottMC's topic in AutoLISP, Visual LISP & DCL
pkenewell, used this make the circle the primary, last obj to select/edit the intention was to clear the global 'pp [true unneeded] q: is there a simpler way? and I use the coords so prefer it 'first' on the cmd-line for copy/paste ------------------- my reg use is 'very.small' - understand! -
El_Che_12345678 started following ReMark
-
Ok, I fix it. Thanks
-
leader and mtext are not attaching
pkenewell replied to pmadhwal7's topic in AutoLISP, Visual LISP & DCL
Unfortunately QLATTACHSET doesn't seem to want to work still -
leader and mtext are not attaching
pkenewell replied to pmadhwal7's topic in AutoLISP, Visual LISP & DCL
Yes - That's it! I looked at the drawing again, and the z dim was off by a very small amount! when I set z to zero on the entities - QLATTACH works.
