Author Topic: Setting rotation parameter without knowing parameter name  (Read 2188 times)

0 Members and 1 Guest are viewing this topic.

Rabbit

  • Guest
Setting rotation parameter without knowing parameter name
« on: February 15, 2013, 06:24:48 PM »
I know how to set a rotation parameter if I know the name of the parameter, but, what if I don't know it?

Here's my situation.  I have a block which has three nested blocks.  Each nested block is tied to a rotation parameter.  These parameters haven't been named, they only have the generic names given to them from AutoCAD, Angle1, Angle2 & Angle3.  I want to be able to set the rotation angle with lisp.  My hope is to allow the user to select the nested block and then input an angle and the parameter associated with the nested block will be set.  This way the user would just click, select some preset angles via Dynamic Input and away we go.  Click, Click, Done.

My problem comes from being able to get the rotation parameter from just a pick.

My first thought was to use something like NENTSEL get the nested block.  Then find the rotation parameter that's associated with it.  This would be the best way if possible.  I cannot figure out how to do that.

Then I thought about trying to find the parameter based on it's origin and a transform matrix from the pick point, via a search of some sort that would return the nearest parameter.  That most likely won't work if there are more than one of the parameters near that point, I might get the wrong one.

Since I can get all of the rotation parameters, my next thought was to have the user cycle through them, trying out each one until they found the one they needed.  And that probably would take longer that manually setting the rotation angle.


What does the collective say?
Thanks,
Rabbit

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Setting rotation parameter without knowing parameter name
« Reply #2 on: February 16, 2013, 07:05:04 AM »
I'm a bit unsure. It sounds as if what you're after can be accommodated using Lookup Table parameter - it allows you to set numerous other parameters through on single click.

E.g. http://cad-notes.com/2009/12/using-lookup-table-in-dynamic-block/
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.