Linear parameter set by attribute value

Linear parameter set by attribute value

jpCADconsulting
Advocate Advocate
707 Views
3 Replies
Message 1 of 4

Linear parameter set by attribute value

jpCADconsulting
Advocate
Advocate

Hi folks,

 

I would like to have the value of an attribute affect a linear parameter in a a block. I feel like I've done this before but it's eluding me. Maybe I';m nuts?

 

In the attached example block there is an attribute (CIRCLE_DIAMETER) and a Parameter (Distance1) with a scale action.

 

I'd like to be able to edit the attribute and have the diameter of the circle change to reflect that value.

I have a block properties table but I think I'd need to pre populate that with every possible value for the attribute...

Any help is appreciated as always.

-JP

 

 

0 Likes
Accepted solutions (1)
708 Views
3 Replies
Replies (3)
Message 2 of 4

Libbya
Mentor
Mentor
Accepted solution

Nope.  In stock AutoCAD changes to attributes cannot drive changes to parameter values.  That is a non-starter.  Even with a block properties table it will not work regardless of how many values you input into the table.  However, you CAN have parameter changes drive changes to attribute values.  See attached.

0 Likes
Message 3 of 4

j.palmeL29YX
Mentor
Mentor

@jpCADconsulting wrote:

 

I'd like to be able to edit the attribute and have the diameter of the circle change to reflect that value.


In this case you don't need a (dynamic) block. You can add an (assoziative) diameter dimension and may edit its value to your needs.

But I think it is only a simplified example and you want more. Please tell us the complete background what you want to achieve. Perhaps we find an other way ...

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 4

Moshe-A
Mentor
Mentor

@jpCADconsulting  hi,

 

Attached sat2dbp.zip (Set ATtribute to Dynamic Block Parameter) contains 2 lisp files:

 

1. sat2dbp.vlx              - the lisp program

2. sat2dbp_supp.lsp   - data lisp file

 

extract these 2 lisp files in folder that is on AutoCAD Support Files Search Path, open your sample drawing with the question block and load sat2dbp.vlx

 

do not rush to test this lisp, first read carefully these instruction

 

first you miss spelled the attribute tag name as "CIRCLE_DIAMTER" instead "CIRCLE_DIAMETER" and i see you did fix it in BEDIT but you did not run ATTSYNC so you need to do update that otherwise the lisp won't work 😀

 

so how this works?

at load, sat2dbp_supp.lsp data file is autoloaded.

 

here is the print:

01) ;;; NOV 01, 2025
02) ;;; by Moshe-A 
03)
04) ;;; this file is autoloaded from sat2dbp.vlx
05) ;;; if sat2dbp_supp.lsp is not found
06) ;;; or MA:APPSDATALLIST is not correctly set,
07) ;;; the following deafult application data is used
08) 
09) ; application data list
10) (setq MA:APPSDATALIST '(
11)			
12)			("block_name"  "tag_name"         "param_name") ; #1, just header
13)			("jp test"     "circle_diameter"  "distance1" ) ; #2, first data line
14)			
15)		       ); list
16) ); setq

 

let's focus on lines #12-13

these are your data lines. line #12 is just a header for you to understand what are the meaning of the data below.

as you can see the first is block_name to be modified, second the attribute tag name and the third the dynamic block parameter to set

 

and what that means? you can add multiple blocks (and tag and param) to be update by this lisp

if this file is not found or the MA:APPSDATALISP variable is not correctly set, the default is used.

 

you can use the property palette to modify the attribute value also EATTEDIT by double click on the block, you can key-in -ATTEDIT but do not key-in ATTEDIT (without the dash) it won't work.

 

just by loading the lisp it is ready to go, no special command to invoke except for the standard AutoCAD commands to set attributes.

 

that's it mate 😀

 

work?

 

enjoy,

Moshe

 

 

 

 

 

 

0 Likes