RevitCity.com Logo

Home  |  Forums  |  Downloads  |  Gallery  |  News & Articles  |  Resources  |  Jobs  |  FAQ  |  SearchSearch  |  Join  |  LoginLogin

Welcome !

39 Users Online (38 Members): Show Users Online - Most ever was 626 - Mon, Jan 12, 2015 at 2:00:17 PM

 

Forums

Forums >> Workflow & Implementation >> API & Third Party Apps >> How to read/edit lighting fixture parameter

Search this ThreadSearch this Thread | Page 1 of 1 |

Wed, Jan 15, 2014 at 7:24:03 PM | How to read/edit lighting fixture parameter

#1

kukuzry


active

Joined: Sun, May 5, 2013
0 Posts
No Rating


(1) How to read the lighting fixture parameters: initial color and inital intensity. In the DB snoop, the value is always 0 (2) I have to retrieve some family symbols belonging to the same category. But different symbols have different parameter names defined by users. How can I change the instance/type parameter (user defined) names?

This user is offline

 

Thu, Jan 16, 2014 at 7:25:20 AM | How to read/edit lighting fixture parameter

#2

WWHub


site moderator|||

Joined: Tue, May 16, 2006
13079 Posts
3.5 Stars: 395 Votes


You can open any family and export the shared parameters in that family to a shared parameter file.  Whenever possible, use parameters that are standard in Revit files.  So once you have the parameters in your shared file, you can edit anyfamily to add these and replace parameters that are not what you want.


This user is offline

 

Thu, Jan 16, 2014 at 8:25:24 AM | How to read/edit lighting fixture parameter

#3

kukuzry


active

Joined: Sun, May 5, 2013
0 Posts
No Rating


I am not clear the method you mentioned.  Let me further explain it further. Assume there is a family files in which users defined some non-shared parameters, to standardize and make them the same name as the standard names defined by me, I want to edit those other user-defined names through API.  


This user is offline

 

Thu, Jan 16, 2014 at 8:42:47 AM | How to read/edit lighting fixture parameter

#4

WWHub


site moderator|||

Joined: Tue, May 16, 2006
13079 Posts
3.5 Stars: 395 Votes


No, you don't understand.  From your HELP:

 

Shared parameters are definitions of parameters that you can add to families or projects. Shared parameter definitions are stored in a file independent of any family file or Revit project; this allows you to access the file from different families or projects.  The shared parameter is a definition of a container for information that can be used in multiple families or projects. The information defined in one family or project using the shared parameter is not automatically applied to another family or project using the same shared parameter.

In order for information in a parameter to be used in a tag, it must be a shared parameter. Shared parameters are also useful when you want to create a schedule that displays various family categories; without a shared parameter, you cannot do this. If you create a shared parameter and add it to the desired family categories, you can then create a schedule with these categories. This is called creating a multi-category schedule in Revit.


This user is offline

 

Thu, Jan 16, 2014 at 8:58:11 AM | How to read/edit lighting fixture parameter

#5

kukuzry


active

Joined: Sun, May 5, 2013
0 Posts
No Rating


Thanks for your clarification. I ask this question because I got some family files from different manufacturers and they use different type parameters names defined by themselves.

So I have to define some shared parameters and import them into all those family files? If I want to change the name, I edit the shared parameter files and then import it to family files again? 

Do you mean that I cannot directly change the names of type parameter defined by the manufactuers thorugh API? I know it is easy to edit or change the names manually by editing the family files.  Thanks,


This user is offline

 

Thu, Jan 16, 2014 at 9:08:17 AM | How to read/edit lighting fixture parameter

#6

WWHub


site moderator|||

Joined: Tue, May 16, 2006
13079 Posts
3.5 Stars: 395 Votes


Do you know if the parameter in question is shared or not?  I doubt that you know.....  Again - from your HELP:

If you click the Modify button in the Family Types dialog, the Parameter Properties dialog opens. You can replace a shared parameter with a family parameter or a family parameter with a shared parameter. Family parameters are specific to one family. You can also replace one shared parameter with another.

Shared parameters are more than a name.  There seems to be some special coding associated with them that allows recognition across multiple families. The export shared parameters allows you to capture any shared parameter and use it whever you want.


This user is offline

 

Sun, May 25, 2014 at 10:11:45 PM | How to read/edit lighting fixture parameter

#7

SamZ1


active

Joined: Sun, May 25, 2014
0 Posts
No Rating


Hi, this is how I set a FamilyInstances parameter. You will need to know the name of parameter to set it - in your case it will be 'Initial Color' and 'Initial Intensity' (maybe 'Initial' is spelt without the second 'i' in America - in Australia we spell it with and i there).

[code]

    public static bool setParameter(Element inst, string paramName, string paramValue, bool nonStringDataType=false)        {            try            {                if (nonStringDataType)                    inst.get_Parameter(paramName).SetValueString(paramValue);                else inst.get_Parameter(paramName).Set(paramValue);                return true;            }            catch (Exception e)            {                return false;            }        }        public static bool setParameter(Element inst, string paramName, double paramValue, bool useStandardMethod=true)        {            if (paramValue == double.MinValue)                return false;            if (useStandardMethod)                return setParameter(inst, paramName, paramValue.ToString(), true);            try {                inst.get_Parameter(paramName).Set(paramValue);                return true;            }            catch (Exception e) {                          }            return false;        }        public static bool setParameter(Element inst, string paramName, int paramValue)        {            try            {                if (paramValue == int.MinValue)                    return false;                return inst.get_Parameter(paramName).Set(paramValue);            }            catch (Exception e)            {                return false;            }        }        public static bool setParameter(Element inst, string paramName, bool paramValue)        {            return setParameter(inst, paramName, paramValue.ToString(), true);        }        public static bool setParameter(Element inst, string paramName, Material material)        {            try            {                inst.get_Parameter(paramName).Set(material.Id);                return true;            }            catch (Exception e)            {                return false;            }        }        public static bool setParameter(Element inst, string paramName, ElementId id)        {            try            {                inst.get_Parameter(paramName).Set(id);                return true;            }            catch (Exception e)            {                return false;            }        }

[/code]


This user is offline

 

Search this ThreadSearch this Thread | Page 1 of 1 |



Similar Threads

Thread/Thread Starter

Forum

Last Post

Replies

Removing constraints on lighting fixture families

Revit Building >> Technical Support

Tue, Apr 7, 2009 at 3:57:35 PM

4

Lighting Fixture

Revit Systems >> Technical Support

Tue, Jan 8, 2008 at 7:33:08 AM

0

lighting fixture basic?

Revit Building >> Technical Support

Sun, Oct 16, 2011 at 8:00:31 AM

9

Linear lighting fixture

Revit Building >> Technical Support

Wed, Sep 2, 2009 at 2:32:08 AM

3

Tagging Lighting Fixture Symbols in RCP

Revit Building >> Technical Support

Fri, Dec 18, 2009 at 1:03:01 PM

1

Site Stats

Members:

2056474

Objects:

23074

Forum Posts:

152326

Job Listings:

3

Sponsored Ads

Home | Forums | Downloads | Gallery | News & Articles | Resources | Jobs | Search | Advertise | About RevitCity.com | Link To Us | Site Map | Member List | Firm List | Contact Us

Copyright 2003-2010 Pierced Media LC, a design company. All Rights Reserved.

Page generation time: 0.8561

Login

User Name:

Password:

Remember Me  

Forgot Password?

Search Forums

Advanced Search

Search Forums

Advanced Search


Clear Highlights


Clear Highlights