AutoCAD Architecture Customization

AutoCAD Architecture Customization

Reply
Highlighted
Contributor
39 Posts
Post 1 of 4
Accepted Solution

Property Set Definition "if a number equals text"

599 Views, 3 Replies
08-08-2012 09:53 AM

Hi All,

 

I having problems trying to resolve a formula in the property definitions. I have a field that has USAGENO 060, 050 that the user inputs. But I would like to auto populate another field ROOMNAME with its corresponding text, to reduce input and avoid user error. The number always equals a room name as shown below.

 

060=Office

050=Lobby

 

I tried on the ROOMNAME field this but its not working, anyone know what is wrong. My field is set to formula.

 

=IF[USAGENO]=060,"Office",IF[USAGENO]=050,"Lobby"))

 

Thank you.

 

alex

This is how i would do it.

 

Select Case "[USAGENO]"

 

     Case "060"

          RESULT = "Office"

     Case "050"

          RESULT = "Lobby"

End Select

 

 

 

Notice the quotes around [USAGENO].  This will cast it to a string.  Also the quotes in the Case statement.  This also casts the values to a string.   I prefer case statements as it allows for easy upgrades in the future if you need to add more room names.

 

Hope this helps.

AUTODESK EXPERT ELITE
1349 Posts
123 Kudos
173 Solutions
Post 2 of 4

Re: Property Set Definition "if a number equals text"

08-08-2012 09:59 AM in reply to: alekzab

This is how i would do it.

 

Select Case "[USAGENO]"

 

     Case "060"

          RESULT = "Office"

     Case "050"

          RESULT = "Lobby"

End Select

 

 

 

Notice the quotes around [USAGENO].  This will cast it to a string.  Also the quotes in the Case statement.  This also casts the values to a string.   I prefer case statements as it allows for easy upgrades in the future if you need to add more room names.

 

Hope this helps.


Keith Brown AutoCAD MEP BLOG | RSS Feed
AutoCAD MEP 2015 | Revit 2015 | EastCoast CAD/CAM V6.1 | Visual Studio 2015
────────────────────────────────────
⁞|⁞ Please use Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos as appropriate. Thank you!
Contributor
39 Posts
Post 3 of 4

Re: Property Set Definition "if a number equals text"

08-08-2012 10:23 AM in reply to: Keith.Brown

It worked! thanks a lot for your help!

 

AlexCat Very Happy

AUTODESK EXPERT ELITE
1349 Posts
123 Kudos
173 Solutions
Post 4 of 4

Re: Property Set Definition "if a number equals text"

08-08-2012 11:17 AM in reply to: alekzab

I forgot to add this portion of it.  I always put an else statement in my select case statement as shown.  you could leave the quotes empty if you don't want to output a message but I always find it good coding practice to have in it there at least.

 

Select Case "[USAGENO]"

 

     Case "060"

          RESULT = "Office"

     Case "050"

          RESULT = "Lobby"

     Case Else

          RESULT = "** ERROR - Usage Number Not Found! **"

End Select


Keith Brown AutoCAD MEP BLOG | RSS Feed
AutoCAD MEP 2015 | Revit 2015 | EastCoast CAD/CAM V6.1 | Visual Studio 2015
────────────────────────────────────
⁞|⁞ Please use Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos as appropriate. Thank you!
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post