ekko Posted April 29, 2022 Posted April 29, 2022 (edited) Hello everyone, when I select an arc in the drawing and modify its radius, the lines or arcs associated with the arc will change accordingly. This seems to require the use of a reactor. Unfortunately, I don't have any experience in this area at present. Knowledge. So I am looking for help here and hope to find a solution. test20220429.dwg Edited April 29, 2022 by ekko Quote
pkenewell Posted April 29, 2022 Posted April 29, 2022 What version of AutoCAD are you using? AutoCAD has had Parametric constraints available in it since Version 2010. Quote
ekko Posted April 29, 2022 Author Posted April 29, 2022 26 minutes ago, pkenewell said: What version of AutoCAD are you using? AutoCAD has had Parametric constraints available in it since Version 2010. The version I am using is AutoCAD2010, will this affect the use of Quote
pkenewell Posted April 29, 2022 Posted April 29, 2022 (edited) 1 hour ago, ekko said: The version I am using is AutoCAD2010, will this affect the use of If you add parametric constraints to the geometry, then it will become "smart" geometry that will update depending on how you apply them. I suggest you look in the help of AutoCAD on "Parametric Constraints". Here is a video explaining them: Edited April 29, 2022 by pkenewell 1 Quote
BIGAL Posted April 30, 2022 Posted April 30, 2022 Also google dynamic door block there are some good examples by regulars here. 1 Quote
ekko Posted April 30, 2022 Author Posted April 30, 2022 (edited) 16 hours ago, pkenewell said: If you add parametric constraints to the geometry, then it will become "smart" geometry that will update depending on how you apply them. I suggest you look in the help of AutoCAD on "Parametric Constraints". (defun c:vv (/ os ss ent_date p1 p2 nent nent1) (setvar "cmdecho" 0) (setq os (getvar "osmode")) (setvar "osmode" 0) (princ "\nSelect Constraint Entities:") (setq ss (ssget)) (setq ent_date (entget (car (entsel "\nselect arc:"))) p1 (cdr (assoc 10 ent_date)) ) (command "_AutoConstrain" ss "") (setq p2 (mapcar '+ (list 425 425 0) p1)) (setq nent (subst (cons 40 200) (assoc 40 ent_date) ent_date)) (entmod nent) (setq nent1 (subst (cons 10 p2) (assoc 10 nent) nent)) (entmod nent1) (command "_DelConstraint" ss "") (setvar "osmode" os) (setvar "cmdecho" 1) (princ) ) I chose simple code and drawings for testing, so that it can get results quickly, obviously this does not achieve my needs Edited April 30, 2022 by ekko Quote
ekko Posted April 30, 2022 Author Posted April 30, 2022 (edited) 4 hours ago, BIGAL said: Also google dynamic door block there are some good examples by regulars here. According to your tips, find related videos on google. My requirement is to use code to operate and implement by selecting entities in the set. If you follow the method you suggested, you may need to go through a lot of judgment, which seems to be difficult to achieve. I am looking for a simple way, which requires the experience and guidance of the big guys. Edited April 30, 2022 by ekko Quote
ekko Posted May 1, 2022 Author Posted May 1, 2022 1 hour ago, BIGAL said: What is hard about I mean it's hard to modify the function of the above drawing by code, not search for tutorials of dynamic door block cadtutor Quote
ekko Posted May 3, 2022 Author Posted May 3, 2022 On 4/30/2022 at 12:28 PM, BIGAL said: Also google dynamic door block there are some good examples by regulars here. How can I get this set data, I try (getvar "_AutoConstrain") but fails, the return value is nil Quote
exceed Posted May 4, 2022 Posted May 4, 2022 15 hours ago, ekko said: How can I get this set data, I try (getvar "_AutoConstrain") but fails, the return value is nil http://www.lee-mac.com/dynamicblockfunctions.html first you can get dynamic blocks properties list by lee mac's solution like this ; http://www.lee-mac.com/dynamicblockfunctions.html (vl-load-com) (defun c:getdynprops ( / ss ssl index ename obj dynblkprops) (setq ss (ssget)) (setq ssl (sslength ss)) (setq index 0) (repeat ssl (setq ename (ssname ss index)) (setq obj (vlax-ename->vla-object ename)) (setq dynblkprops (LM:getdynprops obj)) (princ dynblkprops) (setq index (+ index 1)) );end of repeat (princ) );end of defun ;; Get Dynamic Block Properties - Lee Mac ;; Returns an association list of Dynamic Block properties & values. ;; blk - [vla] VLA Dynamic Block Reference object ;; Returns: [lst] Association list of ((<prop> . <value>) ... ) (defun LM:getdynprops ( blk ) (mapcar '(lambda ( x ) (cons (vla-get-propertyname x) (vlax-get x 'value))) (vlax-invoke blk 'getdynamicblockproperties) ) ) and also get 1 property (your target value) and also set that by Lee mac's modules 1 Quote
ekko Posted May 4, 2022 Author Posted May 4, 2022 (edited) 4 hours ago, exceed said: http://www.lee-mac.com/dynamicblockfunctions.html first you can get dynamic blocks properties list by lee mac's solution like this and also get 1 property (your target value) and also set that by Lee mac's modules I'm sorry for not explaining the problem, the dynamic block properties are not what I want, I just want to get the properties of the automatic constraints that I set, it is similar to (getvar "osmode") to get the object snaps set by the user, but I use (getvar "_AutoConstrain") it doesn't work,In other words, I want to set options for AutoConstrain via code, thanks for the effort my bro Edited May 4, 2022 by ekko Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.