Assigning an action to a dynamic block parameter in the block editor

Assigning an action to a dynamic block parameter in the block editor

tymon067
Contributor Contributor
308 Views
4 Replies
Message 1 of 5

Assigning an action to a dynamic block parameter in the block editor

tymon067
Contributor
Contributor

Hello!

I have dozens of block references to which I would like to add a dynamic parameter.

 

I handled adding the paramter:

(command "_-bedit" (cdr (assoc 2 (entget blk))))
(command "_bparameter" "point" "label" "Name" '(0 0 0) '(0 1 0) 1)

(setq par (entlast))

 

But I have a problem with assigning an action to this parameter, specifically with paramter selection.

I tried to do this in the following ways:

 

Command: (command "_.BACTION" "move" par)
_.BACTION
Select parameter: move
*Invalid selection*
Expects a single object.
; error: Function cancelled

or:

Command: (command "_BActionTool" "move" par)

_BActionTool
Enter action type [Array/Lookup/Flip/Move/Rotate/Scale/sTretch/Polar stretch]: move
Select parameter:
Select parameter: nil

 

or even:

Command: BACTION

Select parameter: !par
<Entity name: 21c039a9f50>

and constantly prompts: Select parameter

 

I also try with ssget instead of entlast, but wothout success. 

 

Have a good day!

 

0 Likes
309 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

(command "_bparameter" "point" "label" "Name" '(0 0 0) '(0 1 0) 1)

 

You know it's coords, use them.

0 Likes
Message 3 of 5

tymon067
Contributor
Contributor

Thanks @ВeekeeCZ 

But honestly, I don't know what to do with this information 🙂

From my point of view, the problem is not in the selection of parameter itself, the problem is more how to process it through "BActionTool" command.

0 Likes
Message 4 of 5

ВeekeeCZ
Consultant
Consultant

Ok, it seems that BACTION requires to have some point. Any point.

 

So for your simple example - you know the coords, the parameter is, as the last object, on top, then a point is enough...

(command "baction" "0,0" "move"...)

 

But as BACTION is stubborn but stupid, you can supply him with ename in the "entsel" pair, and use any point.

(command "baction" (list par '(100000 10000)) "move" ...)

 

PS

(command "_bparameter" "point" "label" "Name" '(0 0 0) '(0 1 0) 1)

Give it some meaningful name, this is confusing.

Message 5 of 5

tymon067
Contributor
Contributor

Thank you for the perfect explanation!

Have a great day 🙂

0 Likes