All Activity
- Today
-
And one last thing: you can't use 'ssadd' as a variable. It's a reserved word in the language.
-
You can calculate this using: (/ (getvar "VIEWSIZE") (cadr (getvar "SCREENSIZE")))
-
Another thing to keep in mind is that calculating a point just 1 drawing unit from the bottom corner of the rectangle may cause "boundary" to not work correctly. You may want to calculate that point by applying the drawing distance equivalent to one pixel.
-
Dadgad started following Remove diameter symbol (Ø)
-
Remove diameter symbol (Ø)
Dadgad replied to EIA's topic in AutoCAD 2D Drafting, Object Properties & Interface
I don't use associative dimensions, but I liked all three of those last suggestions. So many ways to skin a cat in Autocad. -
liucc joined the community
-
Code for mathematical calculations of two numbers
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
The function EXTRACTNUMBER has been added. The code works. Thanks! -
Code for mathematical calculations of two numbers
Steven P replied to Nikon's topic in AutoLISP, Visual LISP & DCL
No, the confused doesn't work... at 400+ posts it wold be reasonable expectation for you to look back at Tsukys other posts to see if the missing LISP function is in there. -
Here is a similar code: Block name in text. EFF_NAME.lsp
-
Code for mathematical calculations of two numbers
Steven P replied to Nikon's topic in AutoLISP, Visual LISP & DCL
So to first principles.... "No function definition" means it is looking for a function "ExtractNumber", I wonder if this was elsewhere in this thread. -
Code for mathematical calculations of two numbers
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
The code with the added function EXTRACTNUMBER. (defun ExtractNumber (str / l rslt) (setq l (mapcar '(lambda (x) (if (and (> x 44) (< x 58) (/= x 47)) x 32) ) (vl-string->list str) ) l (mapcar '(lambda (x y) (if (not (= x y 32)) x) ) l (append (cdr l) '(32)) ) l (vl-remove-if-not '(lambda (x) (eq (type x) 'INT) x) l) l (mapcar '(lambda (x) (if (not (eq x 32)) x (list nil))) l) ) (eval (read (strcat "(setq rslt (list " (apply 'strcat (mapcar '(lambda (x) (if (not (listp x)) (chr x) " ")) l)) "))"))) ) (defun c:Calc2TxtTsk ( / ss1 ss2 val1 val2 key rslt inspt) (princ "\nSelect first text") (while (not (setq ss1 (ssget "_+.:E:S" '((0 . "*TEXT")))))) (princ "\nSelect second text") (while (not (setq ss2 (ssget "_+.:E:S" '((0 . "*TEXT")))))) (setq val1 (extractnumber (cdr (assoc 1 (entget (ssname ss1 0)))))) (setq val2 (extractnumber (cdr (assoc 1 (entget (ssname ss2 0)))))) (cond ((and val1 val2) (if (not op) (setq op "+")) (initget "* + - /") (setq key (getkword (strcat "\nSelect an operation [*/+/-/\/]? <" op ">: "))) (if key (setq op key)) (if (and (eq op "/") (member 0 val2)) (setq rslt 0.0) (setq rslt (apply (read op) (append val1 val2))) ) (initget 1) (setq inspt (getpoint "\nSpecify the insertion point of the result: ")) (command "_.TEXT" inspt "2.5" "0" (rtos rslt 2 2)) ) (T (princ "\No value found in text")) ) (prin1) ) -
THANKS A LOT! you are the best ! many thanks have a nice day
-
Code for mathematical calculations of two numbers
Tsuky replied to Nikon's topic in AutoLISP, Visual LISP & DCL
If you submit integers to the divide function, the result will be an integer. See help ... This is possible: remove the variable "op" from local variables, which could give: (defun c:CalcTwoTxt ( / ss1 ss2 val1 val2 key rslt inspt) (princ "\nSelect first text") (while (not (setq ss1 (ssget "_+.:E:S" '((0 . "*TEXT")))))) (princ "\nSelect second text") (while (not (setq ss2 (ssget "_+.:E:S" '((0 . "*TEXT")))))) (setq val1 (extractnumber (cdr (assoc 1 (entget (ssname ss1 0)))))) (setq val2 (extractnumber (cdr (assoc 1 (entget (ssname ss2 0)))))) (cond ((and val1 val2) (if (not op) (setq op "+")) (initget "* + - /") (setq key (getkword (strcat "\nSelect an operation [*/+/-/\/]? <" op ">: "))) (if key (setq op key)) (if (and (eq op "/") (member 0 val2)) (setq rslt 0.0) (setq rslt (apply (read op) (append val1 val2))) ) (initget 1) (setq inspt (getpoint "\nSpecify the insertion point of the result: ")) (command "_.TEXT" inspt "2.5" "0" (rtos rslt 2 2)) ) (T (princ "\No value found in text")) ) (prin1) ) -
Lisp routine to add hatch geometry to properties from unbounded hatch
GLAVCVS replied to andyb57J's topic in AutoLISP, Visual LISP & DCL
Hi @andyb57J I think you haven't received any further answers so far because we're not sure we understand you. In principle, I believe that any drawing edited in Civil 3D and opened in a standard version of AutoCAD should contain the same information for a 'hatch' object To check if this is the case, do the following: -In Civil 3D, type '(entget (car (entsel)))' in the command line, press ENTER, and then select one of those hatches. Save the information returned by AutoCAD. -Start the standard version of AutoCAD, open the same drawing, type the same code above in the command line, and press ENTER. The result should be exactly the same in both cases. If not, send us a screenshot of both results. -
Pswitch (autocad.exe) launch - to delete and re-import tool palette groups - to resolve the AWS profile issue (tab disorder when an update carried out)
GLAVCVS replied to steve. rogers's topic in AutoLISP, Visual LISP & DCL
Hi This is a bit complicated. I suppose it could be done. Do you have the .atc and .xtp files for the new palettes? -
Trying to layout Church seating using divide and insert block
Cadmando- replied to Cadmando-'s topic in AutoLISP, Visual LISP & DCL
I have tried the array command, but i am just learning Lisp. It one point I tried using AI program to help right the lisp routine. Just trying to get the most chairs in the Sanctuary as possible. I have drawing the lower Sanctuary few times and just thought someone could help me with writing code. After 4 temps to get max chairs, ya wrist is getting tiered. tried script file, but to pause for select arc and number of segments! -
Snoek joined the community
-
SINGFENG joined the community
-
Code for mathematical calculations of two numbers
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Unfortunately, I can't check the code, the same error. ; error: incorrectly generated list at the entrance -
Paulgar8 joined the community
-
Shouldn't it be better, for example, '(polar p1 0.79 1))'?
-
@maahee Are you sure that this point '(polar p1 (* pi 1.75) 1))' will lie inside the rectangle?
- Yesterday
-
Just an idea for internal boundaries, not just one, if you make a list of ((area1 ent1)(area2 ent2)...) you can sort on areas the only one to keep is the second largest area, you have entity names so can erase all the others. Have a go plenty here will help if you get stuck.
-
Code for mathematical calculations of two numbers
Steven P replied to Nikon's topic in AutoLISP, Visual LISP & DCL
think I left in something I was trying - edited now -
See attached code. 1. run the lisp in paper space. 2. the lisp prompt you to select a point on the block IN PAPER SPACE!! - click on the block. 3. click on the start point of the MLeader arrow - you are in paper space, no wories... 4. place the MLeader. 5. if you want to label another block go ahead. 6. to exit hit escape key or mouse right click. EDIT: the lisp works in model space as well. (defun c:MLeaderWBlname( / *error* temperr osnp tm tagname ptms ss ensel obj obj1 nam);ptps ptps1 (setq temperr *error*);store *error* (setq *error* trap1);re-assign *error* (setq osnp (getvar "OSMODE")) (setvar "OSMODE" 0) (setq tm (getvar "TILEMODE")) (princ "Select object in paper space,select start point of MLeader,exit with esc'") (while 1 (if (= tm 0);if in paper space (progn (getpoint) ;;get point in paper space on the target object (command "._MSPACE") (setq ptms (cadr (grread t)));;get the point where the cursor is on the target object in model space (setq ss (ssget ptms));;selction set of the object crossing the ptms point (setq obj(ssname ss 0)) (command "._PSPACE") );progn (progn ;in model space (setq ensel (entsel "\nSelect Block: ")) ;select the block object to copy (setq obj (car ensel)) ;set the block object to varaible );progn );if (setq obj1 (vlax-ename->vla-object obj)) (setq nam (vlax-get-property obj1 (if (vlax-property-available-p obj1 'effectivename) 'effectivename 'name ) ) ) (command "_mleader" "H" pause pause nam) );end while (setq *error* temperr) (princ) ) (defun trap1 (errmsg) (command "._PSPACE") (SETVAR "OSMODE" osnp) (princ) )
-
Deriving attributes from drawing file names
SLW210 replied to Paul Hanson's topic in AutoCAD Drawing Management & Output
If still stuck with LT and no LISP, you might look into leveraging EXCEL. There was a member here did a whole lot of stuff with LT and Excel before LT had basic LISP ability. No guarantee that what you need done can be done in newer LT with LISP as it has limitations. I'll check your drawing when I return to work Monday. -
Same, they block stuff that shouldn't be blocked. Security is pretty easy just like 20 years ago. I set up my wife's workplace (small produce company) she did all of the bookkeeping by hand and was working too much. Since I was doing it for free, after a while, she tried to hire a company to do the IT, they messed it up, so I redid everything. Even Geek Squad did better than the "professional" IT company. Then the wife watched what I had done so she started doing it. Never any issues. Professional IT workers and companies, just block everything because they either don't know how to do it correct and/or just too lazy. Confirmed by Microsoft and other software companies every time I or my coworkers have an issue, solution/cause improperly configured firewall, server or improperly setup software. Recently kept losing AutoCAD licenses, problem, the proxy server/firewall, solution, IT turned it off.
-
Penn Foster Student Suffering with Oleson Village Map!!!
Kayy replied to AutoCad Student's topic in Student Project Questions
Yes and ok I will try that then and I’m sorry for late response I work at night so I sleep through the morning I get off at 7am. -
Xayo joined the community
-
Changing new layer name to show area constraints
ronjonp replied to andyb57J's topic in AutoLISP, Visual LISP & DCL
-
Code for mathematical calculations of two numbers
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
For some reason, the code gives an error... ; error: incorrectly generated list at the entrance