Skip to main content

I am needing to read a DWG and read only the features that meet a regular expression, and wasn't sure if that would be possible. The features have a dynamic suffix to them, but I need to match only part of the name, then read those specific features into the workspace.

Example:

Read only the features that contain "BOUNDARY".

DWG features: BOUNDARY 321, BOUNDARY 123

Thanks for any help.

Hi @madwarren,

When you put the Reader DWG file its possible to make this :

In Feature Type Reader select then Merge Feature Type and write your Boundary with symbol *:

Thanks,

Danilo


Hi @madwarren,

When you put the Reader DWG file its possible to make this :

In Feature Type Reader select then Merge Feature Type and write your Boundary with symbol *:

Thanks,

Danilo

Thanks @danilo_inovacao. I forgot to mention that I'm using a feature reader and I don't see the option to merge with a wildcard. (RealDWG) Any idea of how to get around that?


Thanks @danilo_inovacao. I forgot to mention that I'm using a feature reader and I don't see the option to merge with a wildcard. (RealDWG) Any idea of how to get around that?

So, do you have any attribute name from you feature reader and you would like to extract all lines ( por example ) that the prefix Boundary. Yes?

 

 


Thanks @danilo_inovacao. I forgot to mention that I'm using a feature reader and I don't see the option to merge with a wildcard. (RealDWG) Any idea of how to get around that?

Hi @madwarren, another option is use the transformer Tester after the Reader and configure the option Operator : Begin With = BOUNDARY

 


Hi @madwarren, another option is use the transformer Tester after the Reader and configure the option Operator : Begin With = BOUNDARY

 

I was trying to limit the features that would be read into the workspace, instead of reading all features and then filtering them. Similar to a sql where clause for a database. I just wasn't sure if that would be possible to set it up to find a match (like regex), then read those specific matched features.
I was trying to limit the features that would be read into the workspace, instead of reading all features and then filtering them. Similar to a sql where clause for a database. I just wasn't sure if that would be possible to set it up to find a match (like regex), then read those specific matched features.
Perfect. Yes, i believe is not enable this option for DWG file.

 

 


Hi @madwarren,

Although it is a small extra step, you could you the function 'Feature Types To Read' within the FeatureReader transformer. At the bottom the box has a Filter function which makes it easier to filter all the objects the start with BOUNDARY.

If all the AutoCAD drawings have the same BOUNDARY layers you will only need to set it once.

At the bottom of the FeatureReader you can set the output ports you want, just a single port (like the way you wanted to setup your Merged Feature Type) or One Per Feature Type.

It might not be the ideal situation, but it helps and gives you the opportunity to only read the subset of data you are interested in.


Reply