How to control action parameters via block properties

How to control action parameters via block properties

SChoi7JGJZ
Participant Participant
1,343 Views
19 Replies
Message 1 of 20

How to control action parameters via block properties

SChoi7JGJZ
Participant
Participant

SChoi7JGJZ_2-1743787552122.png

SChoi7JGJZ_3-1743787571715.png

 

 

I want to create a camera block that can have range of viewing angles. The current camera block that we are using has about 20 visibility states starting 10 degrees (shown in picture) to 90 degrees (also shown in picture). As shown in the picture, the two white lines show the 10 and 90 degrees camera angle. I added distance action parameters to the two camera angle lines in the 10 degrees camera to be able to adjust the distance where needed. The problem is that I would need to do this for every single visibility states of this block which got me thinking. Is there a way to add an angle parameter to those two white angle lines and link it to an attribute such that I can type in any angle I want and it automatically adjusts? I would like to get rid of all the visibility states and be able to adjust the angles via an attribute. If not, any other ideas would be appreciated. 

0 Likes
Accepted solutions (1)
1,344 Views
19 Replies
Replies (19)
Message 2 of 20

Libbya
Mentor
Mentor

Post the block.

0 Likes
Message 3 of 20

SChoi7JGJZ
Participant
Participant

Thank you  

0 Likes
Message 4 of 20

MMcCall402
Mentor
Mentor

You could use a block properties table to correlate 2 rotation parameters/actions to handle the camera angle lines. Rotate the lines along with linear parameter and stretch action(s) to modify each of their lengths.

 

I made a Test block in the attached file to illustrate this.

 

MMcCall402_0-1743794486242.png

 

Mark Mccall 
CAD Mangler


EESignature


VHB - Engineering, Inc.

0 Likes
Message 5 of 20

SChoi7JGJZ
Participant
Participant

Is there a way to type in a value to set the angle? And is there any way to link this value into an attribute in block properties?

0 Likes
Message 6 of 20

Libbya
Mentor
Mentor

You can correlate the rotation of the two lines (and allow any angle) without using the block properties table.  See attached.

0 Likes
Message 7 of 20

Libbya
Mentor
Mentor

@SChoi7JGJZ wrote:

Is there a way to type in a value to set the angle? And is there any way to link this value into an attribute in block properties?


Yes, in the block I just posted, you can type the angle in if you select the rotate grip and have dynamic input on.  If necessary it would also be possible to set it up so you could type in the total angle in properties.  Let me know if that is needed.  To link the angle to an attribute, use a blockplaceholder field referencing the rotate parameter.  REGEN is needed to see the updated value immediately after making a change to the angle, but it will update automatically with save, plot, close, etc... so nothing bad happens if you don't REGEN.  If you don't care about the infinite adjustability and prefer the block properties table version, then you can actually add the attribute to the table and write the values directly with no regen needed to see the update.  Let me know if you have questions on any of that.

0 Likes
Message 8 of 20

SChoi7JGJZ
Participant
Participant

Yes, could you explain further on how to make it so that I can type the angle in the properties. Currently the angle1 and angle2 that are shown in the parameters are angles that add up to 360 degrees. The actual angle value between the two lines is what I want to be able to type in and this is because I need to show that value in a schedule. For example, if it's a 40 degree cam, the block you made shows angle1 = 20 degrees and angle2 = 340 degrees. Is there any way to make it so that I can get the actual angle between the two lines and have that in the properties? Thank you!

0 Likes
Message 9 of 20

Libbya
Mentor
Mentor

Angle2 should be set not to show in properties.  Changing it in properties will break the block.  The angle can be typed into Angle1 in properties and the total angle will always be 2X what is typed in.  I don't see how to keep the infinite adjustability with typing in the total angle, but you can use either a block properties table or a lookup for specific values.  In the attached block I added a lookup called TOTAL ANGLE and set it and Angle1 as the only parameters to show in properties.  I set up the rows in the lookup table for total angles of 10-180 in 10 degree increments.  I added an attribute with a default formula field referencing Angle1 and displaying 2X its value.  

Message 10 of 20

SChoi7JGJZ
Participant
Participant

That is awesome. The default formula field is great to know. It sounds like I can use your infinite adjustability version with this as well. With that said, I am having trouble how you set up the block. Could you briefly explain that how you were able to link the two angle parameters to rotate in opposite directions with one grip? Thank you

0 Likes
Message 11 of 20

Libbya
Mentor
Mentor

Notice that Position1, X Y Distance1 and Angle2 all have their chained property set to Yes, so when acted upon, their actions are activated. 

 

The reverse rotation flow path is as follows.  Angle1 rotates the chained Position1 point.  Position1 point stretches XY Distance1.  XY Distance1 stretches Angle2 using two stretch actions: stretch3 and stretch4.  Stretch3 is Y only with a distance modifier of -1.  Stretch4 is X only with distance modifier of 1.  They both stretch Angle2 in a CCW rotation.  Angle2 rotates the lower visible line and the Distance2 parameter.

 

Let me know if you have further questions.  

0 Likes
Message 12 of 20

SChoi7JGJZ
Participant
Participant

For the infinite adjustability version. Is there a simple way to limit the angle to a certain value (120 degrees perhaps)? 

0 Likes
Message 13 of 20

SChoi7JGJZ
Participant
Participant

SChoi7JGJZ_0-1746018491021.png

What is the purpose of these two rotation actions? One of them has 3 selection sets and the other one has 1. Also, what is the reasoning behind having position 1 point stretching xy distance 1?

 

0 Likes
Message 14 of 20

SChoi7JGJZ
Participant
Participant

Another question, is there a way to add a angle parameter + rotation action to rotate the entire camera? I add this in and selected all of the parameters, but the XY distance parameter seems to be throwing the angle lines off when I attempt to rotate the whole camera.

0 Likes
Message 15 of 20

Libbya
Mentor
Mentor

@SChoi7JGJZ wrote:

For the infinite adjustability version. Is there a simple way to limit the angle to a certain value (120 degrees perhaps)? 


Sure.  Select Angle1, go to properties and set the maximum to 60.

 


@SChoi7JGJZ wrote:

SChoi7JGJZ_0-1746018491021.png

What is the purpose of these two rotation actions? One of them has 3 selection sets and the other one has 1. Also, what is the reasoning behind having position 1 point stretching xy distance 1?

 


Rotate2 (the one on the left) rotates the top line.  Rotate (the one on the right) rotates Position1.  I don't know what you mean when you say that one of them has 3 selection sets.  Rotate is set to have its base independent and the base is moved to the center of the construction line circle where the XY and Position1 reside.  Position1 is chained so when it is rotated, it stretches the XY parameter.  The XY has two stretch actions associated with it and those stretch actions are separated into X only (Stretch4) and Y only (Stretch3). Stretch3 (Y only) has its distance modifier set to -1 and is the key to the counterclockwise rotation of Angle2 which in turn rotates the bottom line.  Clear? 

0 Likes
Message 16 of 20

Libbya
Mentor
Mentor

@SChoi7JGJZ wrote:

Another question, is there a way to add a angle parameter + rotation action to rotate the entire camera? I add this in and selected all of the parameters, but the XY distance parameter seems to be throwing the angle lines off when I attempt to rotate the whole camera.


Post your current version of the block for further assistance.  Yes, I believe what you would like to accomplish is possible but working within your updated block would confirm it.  I think that it should work to add another rotate parameter that rotates the camera lines, Angle1, Distance1, and Distance2, and it would work fine.  Adding the XY, Position1, or Angle2 to that new rotate action would be a mistake.

0 Likes
Message 17 of 20

SChoi7JGJZ
Participant
Participant

Here is the block. I have added the rotation action with the selection sets you indicated and it seems to be a bit off. Please let me know. Thank you for the help!!

0 Likes
Message 18 of 20

Libbya
Mentor
Mentor
Accepted solution

If you had set it up the way I set my block up and added the rotation the way I had mentioned it would have worked but there are some differences that matter.  To fix your version I had to set BACTIONBARMODE to 0 in order to be able to add actions to the selection sets of other actions.  I then set Rotate1 so that its base type is independent, set Rotate2 so its base type is independent and added it to Rotate3, and removed Angle2 from the selection set of Rotate3.  See attached.

Message 19 of 20

SChoi7JGJZ
Participant
Participant

Wow, you are a whiz. Thank you so much. If you don't mind, what was different between your version and my version that caused the rotation block not to work? 

0 Likes
Message 20 of 20

Libbya
Mentor
Mentor

The issue was that the Rotate1 and Rotate2 actions were not set to be independent.  I had done that just to separate the chained actions away from the main parameters/linework, but with the added rotation they need to be, even with all the actions stacked on top of each other like they are in your version.  I had also imagined the camera rotation to be centered on the same axis as the existing rotation.  

0 Likes