All Activity
- Past hour
-
Creating a rectangle around the perimeter of a selected rectangular object
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Lisp ObjBoundary involves creating frames for different objects (not just blocks), so the insertion point should not be taken into account here (imho)... -
This is great code, but Top Left and Top right does not move the leader up. Is it possible to sort through the placement options by clicking on the dimension (without using the dialog box)?
- Yesterday
-
Multi radio buttons.lspGive this a try. ; https://www.cadtutor.net/forum/topic/97280-toggle-dimension-lisp/ ; dim_sample.dwg move dime to one of the 4 quadrants ; By AlanH April 2025 (defun c:dodimcorner ( / ent obj dotl dotr dobl dobr) (defun dotl ( / ) (setq tpos (mapcar '+ (cdr (assoc 13 entg))(list 0 dimsc 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (defun dotr ( / ) (setq tpos (mapcar '+ (cdr (assoc 14 entg))(list 0.5 dimsc 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (defun dobl ( / ) (setq tpos (mapcar '+ (cdr (assoc 13 entg))(list 0.0 (- dimsc) 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (defun dobr ( / ) (setq tpos (mapcar '+ (cdr (assoc 14 entg))(list 0.0 (- dimsc) 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already (setq ent (car (entsel "\nPick a dim "))) (setq entg (entget ent)) (setq obj (vlax-ename->vla-object ent)) (setq dimsc (vlax-get obj 'scalefactor)) (if (= but nil)(setq but 1)) (ah:butts but "V" '("Choose a corner" "Top Left" "Top right" "Bottom left" "Bottom right" )) (cond ((= but 1)(dotl)) ((= but 2)(dotr)) ((= but 3)(dobl)) ((= but 4)(dobr)) ) (princ) ) (c:dodimcorner)
-
Jobel98 joined the community
-
Creating a rectangle around the perimeter of a selected rectangular object
Stefan BMR replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Hi Nikon Isn't more easy, in your case, to get the insertion point as the lower-left corner, and for the top-right corner just add the width, height? Multiplied with the scale, if necessary. -
Is such an algorithm possible for this task? Select dimension: 1st click on the dimension - dimtext moves along with the leader Top Left 2 st click - dimtext moves along with the leader Top right 3 st click - dimtext moves along with the leader Bottom left 4 st click - dimtext moves along with the leader Bottom right. The offset from the dimension line should be equal to the height of the text (or two text heights).
-
Creating a rectangle around the perimeter of a selected rectangular object
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Hi @GLAVCVS thanks! This code makes the block Obedient. Muchas gracias! Es super! Te debo otra taza de cafe... -
Creating a rectangle around the perimeter of a selected rectangular object
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Use it on any block of this type and save it -
Creating a rectangle around the perimeter of a selected rectangular object
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Hi Try this (defun c:makeBlockObedient (/ conj it n e le) (princ "\nSelect block to analyze...") (if (setq conj (ssget '((0 . "INSERT")))) (while (setq it (ssname conj (setq n (if n (1+ n) 0)))) (while (/= (cdr (assoc 0 (setq le (entget (setq e (entnext (if e e it))))))) "SEQEND") (if (assoc 60 le) (if (setq p (getpoint (cdr (assoc 10 le)) "\nInvisible attribute detected: Indicates its new position (RIGHT CLICK to skip)...? ")) (vla-move (vlax-ename->vla-object e) (vlax-3d-point (cdr (assoc 10 le))) (vlax-3d-point p)) ) ) ) ) ) (princ) ) -
Steven P started following number texts with pick...help
-
number texts with pick...help
Steven P replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
I did this using Lee Macs Copy Swap Text LISP as a basis, adding in the increment portion as required. -
AutoCAD .NET API - Arc sometimes drawn in wrong direction (clockwise instead of counter-clockwise)
Danielm103 replied to DeEng's topic in .NET, ObjectARX & VBA
Imho use vectors. Note angleTo is overloaded to take a normal @Ap.Command() def doit(): try: db = Db.curDb() p1 = Ge.Point3d(0, 0, 0) p2 = Ge.Point3d(0, 100, 0) vx = Ge.Vector3d.kXAxis vz = Ge.Vector3d.kZAxis d = p2 - p1 dn = p1 - p2 arc1 = Db.Arc(Ge.Point3d(0, 50, 0), 50, d.angleTo(vx, vz), dn.angleTo(vx, vz)) arc1.setColorIndex(5) arc2 = Db.Arc(Ge.Point3d(0, 50, 0), 50, dn.angleTo(vx, vz), d.angleTo(vx, vz)) arc2.setColorIndex(1) db.addToModelspace(arc1) db.addToModelspace(arc2) except Exception as err: traceback.print_exception(err) -
Danielm103 started following AutoCAD .NET API - Arc sometimes drawn in wrong direction (clockwise instead of counter-clockwise)
-
AutoCAD .NET API - Arc sometimes drawn in wrong direction (clockwise instead of counter-clockwise)
Danielm103 replied to DeEng's topic in .NET, ObjectARX & VBA
your units is radians, right? -
Yes It's perfect This is exactly what I need Thank you so much
-
wfrgthyjuikylo joined the community
-
Big Al, I’m not sure I understand. These drawings were created with SDS2 and the material is hyperlinked which is probably why the part mark is coming out of the selected linework. I probably should just sent you an AutoCAD drawing instead.
-
You have many posts so you should know by now all the functions required, so have a go. pick text then atoi (while pick text next number check is 2 or 3 digits <10 <100 so pad with "0" update text entmod or vlax-put 'textstring ) end while
-
Have a look at this it is multiple defuns. But open a file is there. Alan Excel library.lsp
-
Ok can see need to be 4" line with correct 12 as label understand, can do. the 3rd value is internal angle. Watch this space. Just a comment something wrong with label here are you manually drawing rather than say strcat two texts together ? Can do a lisp etc enter prefix enter suffix. 1-hss4 is result. Just have a custom text command. The prefix is remembered change at any time.
- Last week
-
Creating a rectangle around the perimeter of a selected rectangular object
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
No Simply modifying the matrix blocks will solve the problem. If no one can do it on your own, or if no one has done it before, then I'll help you do it tomorrow. -
leonucadomi started following number texts with pick...help
-
hello all: some routine to number like this... 1.-Select a source text with numeric data. example "002" 2.- Then select the texts one by one and number them, giving them the consecutive number to the original value. 3.-Modified texts will always have 3 digits at the end. example: 001 , 034, 100....
-
Creating a rectangle around the perimeter of a selected rectangular object
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
If the attributes are inside the block, then the frame is created correctly. Do I always need to check for hidden attributes? It's a little uncomfortable... -
Creating a rectangle around the perimeter of a selected rectangular object
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
What a good code! Thanks! Is it possible to configure the creation of a frame for dynamic blocks with attributes that go beyond the block? Is it possible to ignore this in the code so that attributes are not taken into account when creating the frame? -
Creating a rectangle around the perimeter of a selected rectangular object
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I guess you should just move those attributes a little to the right and make them invisible again. -
Creating a rectangle around the perimeter of a selected rectangular object
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Use this to see for yourself (defun c:todovis (/ cj n ent lstent) (if (setq cj (ssget "x" '((60 . 1)))) (while (setq ent (ssname cj (setq n (if n (1+ n) 0)))) (entmod (append (entget ent) (list '(60 . 0)))) ) ) (princ) ) -
Creating a rectangle around the perimeter of a selected rectangular object
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Sabotage! -
Creating a rectangle around the perimeter of a selected rectangular object
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
-
Creating a rectangle around the perimeter of a selected rectangular object
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Hi @GLAVCVS The blocks are obedient, but the bounding box is disobedient... OBJBOUNDARY.dwg