Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lookup Help

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
m_rogoff
672 Views, 16 Replies

Lookup Help

See referenced block attached. It basically has 3 settings (bent with a rotation parameter, straight, and epoxy) that is mirrored about the Y axis. I want to have 2 lookup tables, one for each side. The options would be Straight, Bend at 90, Bend at 135, Bend at 180, epoxy so it would act like each side has indepent visibilty states. I'm not quite sure how to accomplish this. Thanks for your help

16 REPLIES 16
Message 2 of 17
Libbya
in reply to: m_rogoff

I looked at your block.  You're halfway there.  In order to get the two faux visibility states to work, you need the two selection lookups.  Those then need to change their own independent input property.  You then need to add a double-lookup.  One of the tables on the double-lookup determines the lookup property which then changes the visibility state on the second table.  

 

Here are the steps to get the two visibilities working:

Add a point parameter and place it at 1,1 with no grips and name it Input.

Add a double lookup, again no grips.

Make sure system variable BACTIONBARMODE=0.

Make Lookup1 and Lookup2 parameters visible for all states.

Open the lookup table for lookup1.

Add InputX as the input parameter.

Add the lookup properties Bend, Straight, Epoxy.

Make the input value 1 for Bend, 2 for Straight and 3 for Epoxy.

Close the table.

Open the Right selection table.

Add InputY as the input parameter.

Add the lookup properties.

Add the same values.

Close the Right lookup table.

Go to the double lookup and name one of the tables Input and the other Vis.

Open the Vis table.

Add the visibility parameter as the input.

Add a row for each visibility state.

Name each of the lookup properties to correspond to the vis - B-B, B-S, B-E, etc.....

Open the input table.

Add InputX and InputY as input properties.

Add the correct input properties so that they match the appropriate visibility state.

 

For future reference, the default input position must match the default visibility state (the topmost in the visibility dialog).  In this case the default visiblity is Bend-Bend.  The default position for the input position is 1,1.  The default value for that row on the input table of the double lookup is 1,1 so all is good there.

 

See attached.  

Message 3 of 17
m_rogoff
in reply to: Libbya

Libbya, thank you very much for your help. I was able to add rotation parameters to the lookups as well, so I can choose a specific angle (90, 135, 180) in the dropdown menu.

 

I am still working my way through the double lookup, just trying to get a good grasp on the concept. The move parameter for input is a neat trick, BTW

 

Thanks again

Message 4 of 17
Libbya
in reply to: m_rogoff

The basic concept for the double-lookup is that there are two tables.  One table is used for Input (can be Read Only) and is used to determine the 'Lookup Property' row on the right.  The second table is used for Output (must 'Allow Reverse Lookup') and forces the parameter values to the value of the Lookup Property row that was determined by the input table.  Any forced changes to other parameters go on the output table.  Any parameter values that the user will affect go on the input table.  It can be a challenging concept, but also allows another powerful level of control in dynamic blocks.

Message 5 of 17
m_rogoff
in reply to: Libbya

I added more options in the lookup, specifically the bend angles and stretch lengths. When I change from 180 to straight back to (90, 135, or 180) the elbow radius gets messed up. Any idea what is causing this behavior? Thanks

Message 6 of 17
Libbya
in reply to: m_rogoff

You were making Distance4 0 and then moving it and doing so lost the angle.  There was not any reason to make it 0 as it is not visible in that state.  Is there a reason to change the distance with the lookup?

Message 7 of 17
m_rogoff
in reply to: Libbya

Hi Libbya,

 

This block keeps evolving. I modified it so there are different sizes with a straight or bend option. I am trying to use one angle rotation parameter and move the base point as the size dictates (this is not working correctly). The left lookup arrow is not showing up, I am guessing there is an error in the table properties, and I have a feeling it's in the Input. I'd also like to have the right side (green dashed line) to turn on/off. I thought scaling it to 0 to turn off would be a good way to avoid doubling my visibilty states. Any other creative solutions?

 

I'd like to have 2 drop down menus, one to choose the size (#4 - #9) and one to choose the bend angle with built in distance parameters based on the size.

 

Thank you once again

 

(Block attached)

Message 8 of 17
m_rogoff
in reply to: m_rogoff

USE THIS BLCOK INSTEAD.  sorry

Message 9 of 17
Libbya
in reply to: m_rogoff

I just looked briefly at your block.  I think you could use a scale action for the size rather than using all the visibility states.  You'd have to use an associative hatch and stretch the boundary for the center line so that you could scale width without changing the length.  I started with an earlier version and added another lookup at the bottom left for size.  See attached.    

Message 10 of 17
m_rogoff
in reply to: Libbya

Thank you Libbya, I will play around with the scaling.

 

The version you used is now outdated. For "ReinfBend3" (attached) I cannot figure out why the left lookup table is not displaying. Does it have to do with the Input properties, or....?

Message 11 of 17
Libbya
in reply to: m_rogoff

Lookups do not display with grips unless they 'allow reverse lookup' and rightfully so.  'Allow reverse lookup' forces the input parameters to the value of the selected row.  When a table does not allow reverse lookup, that means that the table has more than one row that matches the lookup property and so there would be no way to select which of the rows the user wanted. 

 

The block can all work as you would like, but you will need to change your approach.  I think that the simplest solution is to use the scaling method I suggested.  The issue with using the left selection lookup in the manner you show is that you are trying to incorporate both the 4 left selection options AND the size options which are controlled by the right selection lookup.  You cannot combine both in one table.  You would need to use a double-lookup for that.  You would then have the left lookup have the angle choices and adjust an input parameter and you would have the right selection with the sizes adjust a different input parameter.  You then add the double lookup with those two inputs on the input table and adjust all your output values on the output table in the same way that you did with the visibility states.  You could use the current visibility double lookup, but the table may get unweildy in size.  

Message 12 of 17
m_rogoff
in reply to: Libbya

I am getting closer and closer. I got the left Lookup to display as Allow Reverse Lookup. However, I would like to only see 4 options for each size (ie: #6 option would only show #6 90, #6 135, #6 180, #6 Long) instead of the entire list. How do I do this?

Also, the base point for rotation parameter keeps getting offset. I set the base point to Independent and it's being stretched by the D12 Linear parameter in the X direction and Moved with Bend Rad Point/move parameter in Y direction. Would it simplify things just to add a new angle for each size and manually force the base point? If I have 6 separate rotation angles and only one is visbile per visibilty state, how do I eliminate the value in the Lookup table?

 

Thanks

Message 13 of 17
Libbya
in reply to: m_rogoff

I tried to explain in my last post.  

 

Lookup4 (previously Left Selection) which has Lookup9 table associated with it, should have (1) input parameter only.  You could use a gripless position parameter and use its PositionX.  It should have a total of (4) rows which correspond to the (4) desired lookup properties (angles).  The input values can be any 4 numbers, but for convenience I would make them 1, 2, 3, 4.  

 

Right Selection should also have only (1) input property.  You can then have your (6) rows that correspond to your (6) sizes.  You could use the PositionY of the same position parameter used in the angles selection table.

 

You then have a double lookup.  The input table of the double lookup should have (24) rows that correspond to the 24 permutations of your input properties used for Lookup4 and Right Selection described above.  The Input table should have only the two input properties used on the two selection table (e.g. PositionX and PositionY).  The ouput table is where you would place all of the parameters you would like to have affected by the two selection lookups and their appropriate values.   

 

You should have your visibility parameter on only one output table.  In your last posted block you have the visibility parameter added to Lookup3, Vis, and Vis2.  The block cannot work that way.

 

Message 14 of 17
m_rogoff
in reply to: Libbya

Libbya, I followed your instructions but am still having some issues with this block. 

 

For the Input X, the length equals the bar size (4"=#4, 5"=#5, etc) and for the Input Y 1"=90, 2"=135, 3"=180, 4"=Long (no bend). I am still having trouble with the right Lookup ("Bar Size") cycling through the sizes. This is also screwing up the base point of the rotation angle (which is controlled by Linear Stretch "Bend Rad"). I had to add the Bend Rad properties to the right selection lookup or the rotation base point doesn't move and skews the angle. The Left Lookup ("Left Selection") does not recognize Long (no bend).

 

What am I doing wrong?! Thanks again 

Message 15 of 17
Libbya
in reply to: m_rogoff

The problem with the skewed rotation is because your rotation action rotates all of the pieces around whichever rotation base point location is currently determined by the Bend Rad position.  If you change the angle in one size, all the other sizes become skewed as they rotate around the base point when it is in the wrong place for their rotation (they rotate even when they are not visible).  When you then switch visibility states, you see they are skewed.  It does not have anything to do with which lookup table controls the 'Bend Rad' parameter.  You should add a rotate action to the Angle parameter for each bend radius.  Each rotate action should be changed so base type is independent and then the rotate action's base point should be placed at the correct point for each visibility state.  Each rotate action should have only the objects from its visibility state within its selection set.  At that point, the Bend Rad would move the Rotate parameter in order to have the correct display of grip/base for a given visibility state but would not affect the any actual rotation base point.  

 

You should consider the 'Left Selection', 'Bar Size' and 'Vis' all to be output tables as they each are used to force parameters into specific values.  You should not ever have the same parameter on more than one output table at the same time.  It does not help anything and only causes problems either with the action of the block or with diagnosis of the unwanted action.  You currently have 'bend rad' and 'angle' on BOTH the Vis table and on either Left Selection or Bar Size.  Stop doing that.  Each time you do that you are creating conflicts within the block that cannot be resolved. 

 

To avoid the block being dysfunctional prior to all input lookups being adjusted, you need to match your Input property positions within the block to a row of the vis table and that row must match the default visibility state (topmost on the list).  4 Bend is the top visibility state.  The block is drawn with the 135° angle.  Because of this, the default lookup property for the Bridge parameter should be the 4135 row.  The input properties on the Input table that correspond to the 4135 row are InputX=4, InputY=2.  You need to move your Input Base location to X=4, Y=2.

 

As an aside, I should mention that you have a slight drafting error with the arc and line extension.  The arc angle does not end at the point where the line is tangent so you have a bit of a gap at one side of the p-line/arc connection.

 

I still think you would be better off using a scale action to adjust your size rather than all the visibility states.

 

I attached a file where I removed the Angle input from the Left Selection table, removed the Bend Rad from the Bar Size table as I suggested previously.  I added the appropriate rotate actions to the 4,5,6 sizes (you'll have to add the rest) with the appropriate selection sets and base type set to independent and base point moved to the correct location.  I placed the Input parameter at the correct location for the default state of the block.

 

 

 

Message 16 of 17
m_rogoff
in reply to: m_rogoff

I am very close on completing this block. It works as expected, however, it has some "quirks". When first inserted, you cannot change the left pull down until you manually rotate or change the right pull down. It will sometimes not react when you change to "Long". Any suggestions Libbya? Thanks!

Message 17 of 17
Libbya
in reply to: m_rogoff

The reason it doesn't behave initially is because you have a basepoint within the block at a location other than 0,0.  In my opinion, you should never do that in any dynamic block.  Because the bridge lookup is relying on the position of the Input parameter, the non-origin position of the base point parameter causes a discrepancy.   I did not experience the issue with the long state, but I imagine it is related.  Any time you have an action that moves the base point, you must ALWAYS move the input parameter position as well because the input position is relative the base point parameter position.  

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services