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

SQL Query or just an explanation of the expressions tool

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
-HFenby-Taylor-
793 Views, 5 Replies

SQL Query or just an explanation of the expressions tool

Can someone fill me in on the expressions please. 

 

Having a nosey through the sqlite database, I can see how I would select what I want using SQL, for example SELECT * FROM BUILDINGS to select all buildings. As the server is stored in SQLITE, surely it would be a doddle to just give me direct access to the file's database within the program for selection purposes.

 

Oh what I wouldn't give for a bit of SQL injection, wait, that sounds wrong.

5 REPLIES 5
Message 2 of 6

Hi,

 

You can filter features through the Model Explorer, by right-clicking on the desired feature and choosing Filter Select. You can then build an expression that will filter the selected feature class by the conditions you set. In the expression, specify a property that captures the desired population that you want to select. For example, to select features within the desired feature class that have a positive elevation offset, you would create the expression Elevation Offset > 0.

 

In your example, for selecting all buildings, simply right click on the Buildings class in the Model Explorer and choose Select All.

 

Here's a help topic from the InfraWorks 2015 online help that explains more about how to select by filter (using an expression). I think this will accomplish what you are asking for.

 

http://help.autodesk.com/view/INFMDR/2015/ENU/?guid=GUID-647059D2-035D-4640-B90D-B6F840811CA4


Principal Specialist, Infrastructure
Message 3 of 6
Colour1
in reply to: elliott.rosenfeld

Ah thanks for the model explorer trick, that was really helpful, thanks!!

 

I think I was expecting more of a nuts and bolts interface into the database.

 

As for the help file link, I'd checked that already, I found that next to useless.

 

            EDIT: Ah, found the link I was after... always find these things after you need them!!   Expressions Reference

 

For example I wanted to select buildings by base colour. so I followed your instructions and then just guessed until I got the expression to work.

 

BASE_COLOR = 'xFFFFFFFF' ???  ... ... ... ... ... BINGO!

 

this doesn't look like json, SQL, C# it encodes a single character, if it was based upon javascript then the double quotation marks should have worked... is this following a specific schema? Is it like PHP?

Message 4 of 6

wow, nice answer e.rosie! help link and all...gave some kudos


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 5 of 6

Thanks jmaeding,

 

Happy to help!

 

Best,

Elliott


Principal Specialist, Infrastructure
Message 6 of 6
elliott.rosenfeld
in reply to: Colour1

Hi Colour1,

 

I just wanted to follow up in regards to your comment:

 

"I think I was expecting more of a nuts and bolts interface into the database....this doesn't look like json, SQL, C# it encodes a single character, if it was based upon javascript then the double quotation marks should have worked... is this following a specific schema? Is it like PHP?"

 

~ The answer is that InfraWorks does not provide an SQL interface for the expression editor. The query language is an FDO expression language also used in other Autodesk products, such as Map 3D. If you haven't already, check out these reference pages for FunctionsOperators, and Options in the help docs. Each specific type of Functions, Operator and Option has specific syntax examples provided (for example, see this help topic).

 

I'm sorry that I do not have a better FDO syntax reference to provide you, but here are some good starting tips:

 

  • Anatomy of the Expression Editor
  • The result of a filter expression must be a Boolean value.
  • The syntax for an expression that evaluates a property is slightly different, depending on whether you use an operator, a function, or an option. For an operator, the basic syntax is Property OPERATOR Value. For functions and options, the basic syntax is Function (PROPERTY).
  • You can use operators and functions to calculate a new value based on existing property values. You can use the resulting value to filter or select data. The syntax for calculations varies, depending on whether you use operators or functions.
  • Use the Values Pane in the Expression Editor to view or insert valid values for any property in the selected data set. You cannot view or insert values when you are creating a calculation.

 

Best,

Elliott


Principal Specialist, Infrastructure

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

Post to forums  

Rail Community


Autodesk Design & Make Report