Leaderboard
Popular Content
Showing content with the highest reputation on 04/28/2023 in all areas
-
; offset increment numbering with change direction - 2023.04.28 exceeds (vl-load-com) (defun c:WCOPY ( / ss util en ent alignpt obj originalnum basept ang deg dist rotateold rotateinput rotatememory newnewobj ss2 en2 ent2 alignpt2 counter) (sssetfirst nil) (setvar "cmdecho" 0) (setq counter 0) ;error control (defun *error* ( msg ) (if (>= counter 1) (progn (setq alignpt2 (cdr (assoc 11 (entget (entlast))))) (if (= alignpt alignpt2) (progn (vla-delete newnewobj) (princ "\n Temporary Object Deleted.") ) ) );end of progn );end of if (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (setvar 'cmdecho 1) (princ) ) (setq util (vla-get-utility (vla-get-activedocument (vlax-get-acad-object)))) (setq ss (ssadd)) (princ "\n Select Original Number (Text) : ") (if (setq ss (ssget '((0 . "TEXT")))) (if (= (sslength ss) 1) (progn (setq en (ssname ss 0)) (setq ent (entget en)) (setq alignpt (cdr (assoc 11 ent))) (setq obj (vlax-ename->vla-object en)) (setq originalnum (atoi (vl-princ-to-string (vlax-get-property obj 'TextString)))) (setq basept (getpoint "\n Pick Base Point : ")) (setq ang (angle basept alignpt)) (setq deg (* 180.0 (/ ang pi))) (setq dist (distance basept alignpt)) (cond ((or (<= 315 deg) (< deg 45)) (setq rotateold "D") (princ "\n Direction : Right") ) ((and (<= 45 deg) (< deg 135)) (setq rotateold "W") (princ "\n Direction : Up") ) ((and (<= 135 deg) (< deg 225)) (setq rotateold "A") (princ "\n Direction : Left") ) ((and (<= 225 deg) (< deg 315)) (setq rotateold "S") (princ "\n Direction : Down") ) ) (command "_tjust" ss "" "mc") (while (= 1 1) (setq rotateinput (strcase (getstring "\n Change Direction? Up(W), Down(S), Left(A), Right(D), Keep Previous Direction(SpaceBar)"))) (if (= rotateinput "") (if (= rotatememory "") (progn (setq rotateinput rotateold) ) (progn (setq rotateinput rotatememory) ) ) (progn) ) (princ "\n Direction : ") (princ rotateinput) (cond ((= rotateinput "W") (princ "Up(W) Selected.") (cond ((= rotateold "D") (setq newdeg (+ deg 90)) ) ((= rotateold "W") (setq newdeg deg) ) ((= rotateold "A") (setq newdeg (- deg 90)) ) ((= rotateold "S") (setq newdeg (+ deg 180)) ) (t (setq newdeg deg) ) ) ) ((= rotateinput "A") (princ "Left(A) Selected.") (cond ((= rotateold "D") (setq newdeg (+ deg 180)) ) ((= rotateold "W") (setq newdeg (+ deg 90)) ) ((= rotateold "A") (setq newdeg deg) ) ((= rotateold "S") (setq newdeg (- deg 90)) ) (t (setq newdeg deg) ) ) ) ((= rotateinput "S") (princ "Down(S) Selected.") (cond ((= rotateold "D") (setq newdeg (- deg 90)) ) ((= rotateold "W") (setq newdeg (+ deg 180)) ) ((= rotateold "A") (setq newdeg (+ deg 90)) ) ((= rotateold "S") (setq newdeg deg) ) (t (setq newdeg deg) ) ) ) ((= rotateinput "D") (princ "Right(D) Selected.") (cond ((= rotateold "D") (setq newdeg deg) ) ((= rotateold "W") (setq newdeg (- deg 90)) ) ((= rotateold "A") (setq newdeg (+ deg 180)) ) ((= rotateold "S") (setq newdeg (+ deg 90)) ) (t (setq newdeg deg) ) ) ) (t (setq newdeg deg) ) ) (setq ang (* pi (/ (+ newdeg 180) 180))) ;(princ ang) (setq basept (polar alignpt ang dist)) ;(princ basept) (setq newnewobj (vla-copy obj)) (setq counter (+ counter 1)) (setq ss2 nil) (setq ss2 (ssadd)) (setq en2 (vlax-vla-object->ename newnewobj)) (ssadd en2 ss2) (vlax-put-property newnewobj 'TextString (+ originalnum 1)) (setq ent2 (entget en2)) (command "_move" ss2 "" basept pause) ;(command "_pasteclip" pause) (setq originalnum (+ originalnum 1)) (setq rotatememory rotateinput) );end of while ) (progn (princ "\n Select 1 Text Only.") (c:WCOPY) ) ) ) (setvar "cmdecho" 1) (princ) ) Long time no see. this uses command instead of grread. because I want to be able to see the preview & using osnap. Move Command is easy way for me. Command : WCOPY 1. Select 1 Text (Number) 2. Pick Base Point 3. lisp check your Direction 4. Select Direction - Press W/A/S/D or SpaceBar 5. Pick Target Point2 points
-
Not sure and untested... (command "_.CIRCLE" "_3p" pause (setq p1 (getvar 'lastpoint)) pause (setq p2 (getvar 'lastpoint)) "_end" pause (setq p3 (getvar 'lastpoint))) [EDIT] Just tested and it doesn't work, sorry... [/EDIT] But this works as I just tested it ... : (command "_.CIRCLE" "_3p" (setq p1 (getpoint)) (setq p2 (getpoint p1)) "\\" (setq p3 (getvar 'lastpoint))) HTH. M.R.2 points
-
2 points
-
Thanks for all the help Steven, and others. The lisp is now working perfectly!1 point
-
1 point
-
The ones labelled 511 and 501 are horizontal dimensions as opposed to vertical dimensions, so of course the result would be as shown in your result. It is a different case than the original post after all. As for one of the dimensions labelled 464, you have the property of the text movement set to "Move text, add leader". The program simply moves the texts, so you may want to change that to "Keep dim line with text", as shown below. With regards to the restricted distance, I will integrate your idea, much like the OFFSET command. I'll let you know when I'm done.1 point
-
If you don't need the dimensions to be at that specific spot, I've already released the program Align To Direction that can align the dimensions to any direction you wish. But if not, I can probably adjust the program to suit. In response to your question 1, have a look at using initget and getkword, this will give you a good start.1 point
-
Ok I am sure already suggested this somewhere. I do not plan on fixing the dims rather just make them what you want 1st go. This is vertical dim to the right 200 offset from the 2nd pick point. NOTE 2ND point. (defun c:dr200 ( / pt1 pt2) (while (setq pt1 (getpoint "\nPick 1st point ")) (setq pt2 (getpoint "\nPick point 2 ")) (command "dim" "ver" pt1 pt2 (mapcar '+ pt2 (list 200.0 0.0 0.0)) "" "exit") ) (princ) ) You want to learn lisp so your task is, the extra defuns, Left, top and bottom the last 2 are hor dims, a hint. Look at "list" in code (list X Y Z) for offsets. dl200 db200 dt2001 point
-
Steven P ;(cond (type ExcelValue) 'INT) (type ExcelValue) 'REAL) (type ExcelValue) 'STR) if str then maybe look for a chr 0-91 point
-
What software are you using for the import points, should be able to fix the offset there, if CIV3D labels they have massive amount of variations but can be edited.1 point
-
Dimensions, I assume you mean a dimension that you might draw using the Dimension command rather than, say a line that is less than 5' but without a dimension marker next to it? How good are your LISP: abilities? If I give you some clues will that be enough or do you want more details? So for part 1, dimensions less than 5 feet: Refer to Lee Macs website: http://lee-mac.com/ssget.html and good tutorial to create a selection set, say ss, using X to select everything and with a filter (0 . "DIMENSION") Make a while loop for the length of the selection set (sslength), and get the entity name of each as you loop (ssname ss counter), then 'entget' that and use 'assoc' looking for the list labelled 42, which is the actual measured dimension If this is less than your distance, draw a circle Not sure if that gives you a starter, but if not it will remind me what to do another evening1 point