How I can select Action Rotation Parameter through lsp or script ?

How I can select Action Rotation Parameter through lsp or script ?

Anonymous
Not applicable
3,037 Views
15 Replies
Message 1 of 16

How I can select Action Rotation Parameter through lsp or script ?

Anonymous
Not applicable

I'm having already Rotation Parameters. I have to select (Action) Rotation parameters. How  i can filter or select ? 

blocks.PNG

Thanks

 

 

0 Likes
3,038 Views
15 Replies
Replies (15)
Message 2 of 16

devitg
Advisor
Advisor

@Anonymous , please upload your sample dwg 

0 Likes
Message 3 of 16

CodeDing
Advisor
Advisor

@Anonymous ,

 

Yes, please share a drawing if you can.

Also, what are you trying to do with the parameter? delete it? move it? Assign a value to it?

 

Best,

~DD

0 Likes
Message 4 of 16

Anonymous
Not applicable

Hi,

 

I already set Rotate Parameters.

I have to give actions for rotation.

If any other(lsp & script ) comments are available for automatic select for action parameter? 

Through script i tried previous / last. But unable to select. 

Can you help with this one?

 

Regards

Murugan

 

 

 

0 Likes
Message 5 of 16

CodeDing
Advisor
Advisor

@Anonymous wrote:

I have to give actions for rotation.


This makes it sound like you are trying to rotate your object. If that is the case, I still do not understand why you need to select the rotation parameter?

Try this:

[in this example, "45" is the number of degrees to rotate, it is converted to radians]

(setpropertyvalue (car (entsel "\nSelect Block: ")) "AcDbDynBlockPropertyAngle1" (* pi (/ 45 180.0)))

Best,

~DD

0 Likes
Message 6 of 16

CodeDing
Advisor
Advisor

@Anonymous @Anonymous ,

 

Please post an example drawing file with an example of the block + parameter you are trying to select.

0 Likes
Message 7 of 16

Anonymous
Not applicable

Hi,

I attached cad and script file also.

 

0 Likes
Message 8 of 16

CodeDing
Advisor
Advisor

@Anonymous ,

 

I cannot figure out how to select the parameter in a method that would work with your script.

 

Perhaps someone else can help better than i?

 

The best I can hope to help you is to ask Why you're needing to create a block / parameters via script? The purpose of a block is to be USED in many places. Why would you need to create a script to CREATE a block in many places?

 

Best,

~DD

0 Likes
Message 9 of 16

Anonymous
Not applicable

Hi @CodeDing 

I have to create Baction through scrpit or lsp

I have to create a blocks many.

Can you help this ? Please find the attached file.

 

1 BParameter
2 R
3 0,0
4 25
5 0
6 0,25
7 1
8 Baction   Run this Command Through Scrpit. But I can't select the Bparameter.

9 P
10 w
11 0.5,-0.5
12 ;-0.5,0.5
13 ;end
 

 

 

0 Likes
Message 10 of 16

devitg
Advisor
Advisor

@Anonymous  Bparameter work inside -Bedit 

 

 

Command:
Command: BPARAMETER
** BPARAMETER command only allowed in Block Editor. **
0 Likes
Message 11 of 16

rapidcad
Collaborator
Collaborator

@kandavelmurugan.shunmugam  I believe you are confused about how to apply a rotation parameter. See my post back in the dynamic block forum. Your dynamic block is not finished yet and programming is not required to add the rotation action. Rotation action is a selection from the Actions palette - you are supposed to pick the Rotation tool on the Action palette, select the Rotation Parameter in your block then select the drawing entities that you want the action to rotate when users grab the grip (once the block is finished).

ADN CAD Developer/Operator
0 Likes
Message 12 of 16

cdmiske
Enthusiast
Enthusiast

@Anonymous 

 

A couple of things:

 

1. I believe that @rapidcad is correct in that you have not assigned an action to your parameter to make it function from the image you posted. That would make the parameter not able to function or even appear when the block is highlighted.

 

2. Here is a link to an article that can explain how to drill down to find parameters and their associated actions on dynamic blocks: http://poleshchuk.spb.ru//cad/2009/tainypode.htm

 

Fair warning on that link though. It is written as if it is a fantasy novel. It can be very entertaining but also frustrating if you down have some understanding about programming in autoLisp already.

0 Likes
Message 13 of 16

Anonymous
Not applicable

You have to go block editor and run the scrpit 😀

 

 

0 Likes
Message 14 of 16

Anonymous
Not applicable

@cdmiske @rapidcad @devitg @CodeDing 

Just create a any dynamic block it may be simple line. For rotation

 

How we can create a dynamic block script or a lsp ? 

 

I can create a dynamic block for manual.

 

Please find the attached file for a line (dynamic block)

 

Murugan

 

 

 

 

 

0 Likes
Message 15 of 16

Anonymous
Not applicable

@devitg  @cdmiske @rapidcad @CodeDing  Can you check the script.(attached file)

I have to go to the next line to finish my dynamic block.

Baction Select Parameter - ( I have to select the parameter - like previous or last ) 

Manually i can select. But i am looking for a script or any other method ? 

Unable to select the parameter - ( how i can select ? ) 

 

 

 

 

 

 

0 Likes
Message 16 of 16

cdmiske
Enthusiast
Enthusiast

@Anonymous 

 

Sorry for not replying back any sooner.

 

I have looked at your block and see that you have assigned it an action. I believe Kent has already posted the question first but what are you wanting the dynamic rotate to do with the lisp routine?

 

If you are simply looking to make the block rotate in increments then that can be setup in the properties under the "Value Set".

 

Otherwise if you are trying to access the rotate action value through lisp code that is not nearly as easy and I have yet to fully understand how to do that myself. Also to the best of my knowledge is still not fully documented in any of the autoCAD documentation.

 

This link does explain it in some detail but does require to have a decent handle on understanding AutoLISP code:

 

http://poleshchuk.spb.ru//cad/2009/tainypode.htm

 

It is frustrating trying to learn new things and sometimes takes time to get a grasp of just how to do what you are wanting through programming.

0 Likes