Hello Farook, You could get pretty close by using File->Batch Deploy with the option to recreate source directories turned on.
For each source dataset you'll get a destination dataset; the reason it isn't exactly what you specified is that a Shape dataset is directory based, so for each input dataset (a DGN file) you'll get a Shape dataset (a directory of shp files). For example if you have d:\abc\02\abc.dgn and d:\abc\02\xyz.dgn both of which have a level named 'roads' then with a batch deploy you'd get d:\abc\02\abc\roads.shp and d:\abc\02\xyz\roads.shp Technically this is the correct method and is certainly easier to set up. If you want to put all the Shape files into the same source directory as the DGNs then I'm not sure how this would work. For example with the above files you'd get... d:\abc\02\roads.shp and d:\abc\02\roads.shp ...ie two files with the same name! Jason's method avoids this problem by concatenating the basename and the feature type but then you get a Shape files with different names (abc-roads.shp and xyz-roads.shp) - I suppose neither method is perfect and it depends on which 'problem' is less of a worry for you. That's my 2 cents anyway. Mark Mark Ireland, Product Support Engineer Safe Software Inc. Surrey, BC, CANADA [EMAIL PROTECTED] http://www.safe.com Solutions for Spatial Data Translation, Distribution and Access -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Birch Sent: June 24, 2005 1:22 PM To: [email protected] Subject: RE: [fme] FME -how extract source dataset directory attribute Make sure you do this on a test directory structure first. This works for me, but comes with no guarantees :) In Workbench, you will need to expose a format attribute to get at this information. Open up the properties on the a source feature type, click on the properties ellipsis (or right-click and select "Properties"). Click on the "Format Attributes" tab and then check off the fme_dataset attribute. If you have multiple source features, click on the "Apply to All" button so that they all have this attribute exposed. You can extract the path from the fme_dataset with a Grepper. Go into the Grepper properties, Select the fme_dataset as the attribute, and enter the following for your regular expression: ^.:\\(.*\\)([^\\]*)$ When you click on OK on the Grepper properties, expand the attribute section on the MATCHED output. Right-click on the _matched_parts{} and select Expose Element, choosing to expose 2 elements. _matched_parts{0} will be (most of) the path, and _matched_parts{1} will be the filename. The attributes fme_basename and fme_type may also be of use to you. Once you have these attributes, you can use them to build the attributes you want to fan out on. In your case, you will need to perform some specific steps because the shapefile format only holds a single geometry type per file. - First, you will want to set up destination feature types for each of the geometry types you expect to process, and set their allowed geometry accordingly. - Second, you will want to make sure that the fme_type attribute is exposed in all of the source feature types (the first thing you did above). - Third, you may want to run this through a SubstringExtractor with values of 4 and -1 to get rid of the "fme_" in the type attribute. - Fourth, you will want to run this through a Concatenator. You will want to concatenate the attribute "fme_basename" with the constant "_" with the attribute "fme_type" (or the resultant attribute from the previous step if you chose to do it) into a new attribute (let's call it "tango" for fun). - Fifth, you will need to set up a GeometryFilter to place the data into the correct streams to go to your output features and connect them to the appropriate features. - Finally, you will have to set up your output features to do a feature fanout on the "tango" attribute. You're still not done though... Go to the Workspace tab on the left hand side of your screen. Right click on your shapefile destination dataset (it'll look something like "filename [SHAPE]" and choose "Fanout Dataset". In "Fanout Prefix", enter your drive letter like: "D:\". In "Attribute to Fanout on" choose _matched_parts{0}. Click on OK. Once again: Make sure you do this on a test directory structure first. This works for me, but comes with no guarantees :) *** Note for SAFE: I would have actually done the dataset fanout by making the drive letter an atom in the regular expression rather than requiring a hard coded value, but the "Fanout Prefix" attribute does not seem to accept the value &_matched_parts{0}. Also, Fanout Prefix requires a value, so I couldn't just leave it off and dump the path into the attribute. *** Jason -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Kemminje Sent: Thursday, June 23, 2005 23:59 To: [email protected] Subject: [fme] FME -how extract source dataset directory attribute Dear Sir, Could you pls solve my problem........... How can I fanout the destination dataset as same as source data set for ex if i have dgn file in d:\abc\01\*.dgn d:\abc\02\*.dgn d:\abc\03\*.dgn d:\abc\04\*.dgn I have selected all the *.dgn files from d:\abc directory with sub folder (d:\abc\***\*.dgn) and I want to translate these dgn files to Esri shape and the destination directory should be d:\abc\01\ d:\abc\02\ d:\abc\03\ d:\abc\04\ Now my question is how can i take attribute for this destination dataset ? what are the transformers can be used ? Please if you can answer to this query please reply to me. Your urgent reply will be highly appreciated. Thanks. With Best Regards Farook Kemminje PIXEL INFOTEK PVT LTD. Bangalore Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our Professional Services team. Visit www.safe.com/services for details. Yahoo! Groups Links Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our Professional Services team. Visit www.safe.com/services for details. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/fme/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
