Skip to main content
I'm trying to read from a csv file a list of 3ds models to convert to sketch-up. Each model also need to be offset to correct insertion point.

 

 

csv file contains for example header included:

 

3dsfile,xoffset,xoffset,zoffset

 

m:\\sourcedata\\models\\test123.3ds,33001.98,58123.76,12.54

 

...

 

54 models in the list

 

the list is generated from a spatial filter

 

 

I've tried the featurereader but it only works with single column cannot get the x,y,z details. also tried scripted parameter, but it only work only a single column

 

 

Any ideas?

 

 

Need to read each line, and offset each model to sketch-up (offset with the values in the csv file

 

 

Rudy.

 

Hi,

 

 

not quite sure I understand your question, but you should be able to use a regular CSV reader to get the 3DS model filenames, pass them on to a FeatureReader (or use a WorkspaceRunner to send them to a second workspace).

 

 

David
csv reader reads sequentialy.

 

U need a regular expression to read the lines and place in attributes.

 

a regular expression wich reads the values and assigns those in the respective attributes.

 

A way to do this in your case is a stringsearcher:

 

(<\\\\*\\w*\\d*\\:*\\.*]*),(]\\\\*\\w*\\d*\\:*\\.*]*),(]\\\\*\\w*\\d*\\:*\\.*]*),(]\\\\*\\w*\\d*\\:*\\.*]*)

 

Expose matched parts 0-3 (rightclick matched parts after unrolling stringsearcher)

 

Asssign them to your attributes 3dfile, xoffset etc.

 

 

If u have those haeaders in the csv u can find those lines with a stringsearcher (\\d*\\w*),(\\d*\\w*),(\\d*\\w*),(\\d*\\w*) (as u have 4 attributes) and then skip the line. Put this stringsearcher before the other one. And attach the other one to the list not found of this one. (waddayasayinm8??)

 

 

 

As the offset part is concerned, i dont know if u mean to move the objects, but in that case u can use 3d affiner to do so. Put x tru z offset in the rows D, H and L respectively.

 

 

 


Hi,

 

 

If fme_dataset of features read by the 3DS Reader indicates the source file path, maybe the FeatureMerger can be used to merge x, y, z offset values from the CSV file to the 3DS features using the source file path as key.

 

 

Takashi
Hi All,

 

 

Thanks for the replies, but looking at your answers it seems that i need to give more info on the problem/question.

 

 

I want to read the the csv file, get the 3ds model name (read the feature), apply to it the xyz move and then convert it to a skecthup file. This need to be applied for each row.

 

 

I can grab the the filename with feature reader, but i cannot work how to for the same feature also grab from the csv the xyz offset parameters and apply it to the 3ds model.

 

 

Takashi - in the csv file the source file is the 3ds model

 

David R - Cannot work out how to pass the 3DS model filenames to the feature reader, because the feature reader wants a directory for dataset

 

 

Rudy V

 

 

 

Reply