Skip to main content
Question

Workspace issues with reading AutoCAD and writing to Geospatial PDF

  • 12 February 2013
  • 9 replies
  • 11 views

Hello,

 

 

I have generated a workspace that does a simple read of an AutoCAD .DWG file and then writes it out in the Adobe Geospatial PDF format.  My workspace finishes successfully for the one .DWG file that I supply to it while testing within FME Workbench.

 

 

My problem is that when I upload a different .DWG file (with different schema) the workspace no longer can finish successfully.  I have to make this work because I will have .DWG files being uploaded to my server from any number of end users who could have created their .DWG files differently.

 

 

Can anyone give me some pointers to allow my request to work properly?  I appreciate any support.  When I find out how to resolve the answer, I will post here for anyone else who may have this problem down the road.

 

 

Thanks in advance!
I'd suggest you look at using the Dynamic Schema mode as this allows you to relax FME's approach to schema. There's some info here as well as several other pages

 

 

http://fmepedia.safe.com/articles/Samples_and_Demos/Dynamic-Schema-Examples-FME2011

 

 

But to quickly set it up as a test just enable the Dynamic Schema Mode when you add your initial Reader and Writer:

 

 

 

 

Hope that helps, Dave
Dave,

 

 

Thanks for the reply. I have tried to start my workspace over from scratch.  I chose "Dynamic Schema" in the workflow options; however, I still have an issue with the translation of any AutoCAD .DWG file that was not run inside of FME Workbench initiallly.

 

 

For example, whatever AutoCAD .DWG file I use on the reader, will work and be converted into an Adobe Geospatial PDF. However, any other .DWG I try to use fails. 

 

 

I will keep trying to figure this out (as I don't have a choice I have to get it resolved) and if I have any luck I will post it back here when I'm done.

 

 

Thanks again.

 


I think my biggest problem here is that I will never know the "reader" schema because it can always be a different end user submitting their .DWG file.

 

 

From that point, I seem to be unable to make one workspace (.fmw) be able to handle more than one .DWG file (which has different schemas for each file)

 

 

Should I be approaching this differently?  I am beginning to wonder if I need to create a new workspace (somehow thru command line) for each .DWG file I wish to convert into a Adobe GeoSpatial PDF.

 

 

Any insight or help would be appreciated on how I can go about conquering this problem?
Hi Nick,

 

 

This is what I mean:

 

 

http://goo.gl/L6Onp

 

 

In this workspace run it using the 'Prompt and Run' button and now you'll be able to pick any DWG to read and optionally pick the layers from within the DWG to read.

 

 

To alter this, go to your existing workspacew and copy your Transformers and just paste them into this workspace then join them up.

 

 

Hope that helps, Dave

 

 


Dave,

 

 

First off, thanks alot for the help.  I am able to run the workspace you provided for whatever .DWG file I select.  I am successfully able to get the Adobe PDF in the end result.

 

 

My problem is that I am executing this workspace from a command line prompt.  Therefore, the aforementioned .DWG file is not the only type of .DWG file that will be needed to be converted into an Adobe PDF.  

 

 

I need to know if it is required to basically build a new workspace (.fmw) for each .DWG file I have to convert into .PDF?   I am assuming the answer to this is yes, simply because each .DWG is going to have their own schema and not match what the initial workspace was built to do?

 

 

I hope my questions makes sense, if not, please let me know and I can try to elaborate more.

 

 

Below is the command prompt code I am running when I executing the workspace (for reference):

"C:\\FME\\ACAD2PDF_dynamic.fmw" --SourceDataset "E:\\UploadedDocs\\ampg0li1v0yv03imc4kdn255\\400220130213.dwg" --DestDataset "E:\\Inetpub\\POCS Web Site\\DrawingExchange\\UploadedDocs\\ampg0li1v0yv03imc4kdn255\\GeoReg-400220130213.pdf" LOG_FILENAME "E:\\Inetpub\\POCS Web Site\\DrawingExchange\\UploadedDocs\\PromoteActivity.log"

 


Hi,

 

 

It's not necessary to create multiple workspaces, that would be a real bind. Instead just adapt your process. I have updated the workspace example here for you:

 

 

http://goo.gl/ME5xl

 

 

The main difference is that it now exposes the name of the input DWG file and employs the Fanout Dataset option on the writer. This way what ever input DWG filename comes in, that is the resulting name of the PDF. If you like you can also use the StringConcatenator to say suffix or prefix this name too. The capability is here:

 

 

 

Now you can just run the process with your command line adapted as follows:

 

 

fme.exe ACAD2PDF_dynamic.fmw --SourceDataset_ACAD C:\\FMEData\\Data\\Water\\*.dwg --FANOUT_DIRECTORY C:\\temp

 

 

Where you say go and read all DWGs in a folder or folders, also subfolders if required (\\water\\**\\*.dwg) or prefixed only (\\water\\**\\water*.dwg) etc and then write them all into an appropriate output location. No need to worry about the individual filenames as that is handled by the fanout.

 

 

Hope I've understood your question correctly.

 

 

 

 


Dave,

 

 

This has helped a lot. My biggest problem is I am still so new to use the FME Software, that I am still trying to grasp how everything works by finding basic video tutorials to do simplistic things.  

 

 

I did get this workspace running and appreciate your help. I feel I may have some more questions down the road as I continue to try to learn all the different things (which seems like hundreds if not thousands of things) that the FME software can do.

 

 

My main GIS software is MapInfo/MapXtreme; however, I have this other project that requires me to take uploaded .DWG files and convert them into geo-registered PDF's and then I use TerraGO SDK Composer to convert the geo-registered PDF into a geoPDF format (as the end result).

 

 

Thanks again for your time and help on this topic.

 

Nick

 

 

 


No problem at all. FME can certainly do a lot of things and you have found the right place for help at least. Though I recommend doing a search on the main FMEPedia page as a first port of call. Also the old FME Talk archives are here and are a useful back reference...

 

 

https://groups.google.com/forum/?fromgroups#!forum/fmetalk

 

 

As far as tutorials/training is concerned there are plenty of movies and intoductions over here:

 

 

http://www.youtube.com/playlist?list=PLC3D48C8695F1DF78

 

 

As well as some tutorials you can work through in your own time here:

 

 

http://www.safe.com/learning/training/

 

 

Happy FME'ing

Dave,

 

 

I hope all is well. I have hit a road block of sorts over a new scenario.  I have been able to successfully convert the AutoCAD file into an Adobe Geospatial PDF.  However, my source AutoCAD data is being supplied by end users and may not always have the same projection.

 

 

Therefore, in learning a little more as I go on here day-by-day, I added an "AutoCAD Reprojector" after reading in the AutoCAD file (see below)

 

Now, I have modfied and tested my workspace because the supplied .DWG file I am using I know has been created with the projection of  "Pennsylvania State Plane South 83 Feet"   I know that by defining the souce project as this value, I can acheive the correct result.  However, if I use either "UNDEFINED" or "UNDEFINED-FOOT", I end up in the middle of the earth (which is obviously not desired)

 

 

Therefore, my question is how would I take my workspace and modify it so that it can be flexible enough to handle any source projection?  

 

 

I have tried to link to my workspace as well with the link below.  It is currently built with the source being "UNDEFINED-FOOT".

 

 

http://mapping.pa1call.org/images/fme/Direct-acad2pdf2d.fmw

 

 

I hope that you get this message and that it makes sense to where I am at a road block. I look forward to hearing from you as I hope that this is something simple I am just not realizing.

 

 

Thanks again in advance!

 

 

Reply