PDA

View Full Version : Field population based on material



spikemann
2008-01-28, 05:46 PM
Hi guys
I need to be able to set a parameter "Product code" to a value based on the material selected. It seems there is no way of using material parameters in the standard interface so I was thinking about an api route.
As someone who has done a bit of vb, I was thinking about OnChangeEvent type scenario.
So that if in in the schedule, they notice a desk has the wrong top material, they can choose the correct one (from the user defined material library) and the product code parameter would be updated instantly.

Does the api have this sort of instant update facility ? If so, an example would be much appreciated.

Thanks guys

Jason

aaronrumple
2008-01-28, 06:54 PM
Hi guys

Does the api have this sort of instant update facility ? If so, an example would be much appreciated.

Thanks guys

Jason

No. The Revit API only allows code to run start to finish as a command. There are no events.

Elizabeth Shulok
2008-01-28, 07:28 PM
No. The Revit API only allows code to run start to finish as a command. There are no events.

Actually there are events. Look at the Application and Document classes. But the events available are limited - you can get notified when a dialog comes up, or when a document is opened, saved or closed (and a few other events).

Although this is probably not sufficient for what you are trying to do, Jason.

spikemann
2008-01-29, 09:28 AM
Okay, then if events are not an option, is there a way to populate the available choices for a text parameter, so that I can get users to choose a colour from a defined list rather than letting them type in any old value. I could then use a normal calculations to generate my part code.

mmason.65315
2008-01-29, 12:22 PM
Look in the Online help under "Schedule Keys"...
That's the best way I know how to do it... You can even have that choice drive other parameters (to some extent, at least).

Best Regards,
Matt