Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Parameter Problem

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
rvetrano
787 Views, 2 Replies

Get Parameter Problem

Hi,

Have code that works in VB.net 2012 trying to learn C# and convert code. Last piece of puzzle.

"Parameter .Definition.Name" is null.

ele.Name = L4x3 1/2x5/16 . so that 's ok

Leg Guage is a parmater I created which is part of the angle.

LegGa = 4.00 which is ok.

 

using C# 2012 and Revit 2015

 

public void ChangeAngleParam(Element ele)
{
ParameterSet @Anonymous = ele.Parameters;
Autodesk.Revit.DB.Parameter Parameter = default(Autodesk.Revit.DB.Parameter);
double ParamElem = 0;
AngleData(ele);
if (ele.Name.StartsWith("L")) {

foreach ( Parameter para in @params)
{
if ((Parameter .Definition.Name == "Leg Guage"))
{
ParamElem = (Convert.ToDouble(LegGa) / 12);
Parameter.Set(ParamElem);
}
}

 

Any advise would be appreciated.

Thanks

Bob V

 

 

 

2 REPLIES 2
Message 2 of 3
sanjaymann
in reply to: rvetrano

Hi,

 

Replace

 

if ((Parameter .Definition.Name == "Leg Guage"))

 

with

 

if ((para.Definition.Name == "Leg Guage"))

 

 

Thanks & Regards

 

Message 3 of 3
rvetrano
in reply to: sanjaymann

Thanks.

Bob v

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community