Skip to main content

How can I read all Paper Spaces from Acad file? I can set 'Read Selected Paper Spaces' parameter, but I need something generic like using * character.

@takashi

That is not possible right now (FME 2016.1) but I've solved it with a Directory & File Pathname Reader reading all dwg-files and then a StringConcatenator:

" "C:\\Program Files\\Autodesk\\AutoCAD 2016\\acad.exe" "@Value(path_windows)" /b "c:\\script.scr" "

And then send the string to a SystemCaller transformer.

The script.scr is a AutoCAD script-file that just calls a AutoCAD lisp-file inside AutoCAD and then closes the DWG-file.

The lisp-file gets the list of Paper Spaces in the DWG-file and stores it is a txt-file with the same file name as the DWG-file and in the same folder. The lisp file could look something like this:

(defun c:layoutToFile()
(setq fl (open (strcat (getvar "dwgprefix") (getvar "dwgname") ".txt" ) "w"))
(write-line (vl-prin1-to-string (layoutlist)) fl)
(close fl)
)

Then you can use the txt-files to read the Paper Spaces with a FeatureReader or with linked workspaces with the WorkspaceRunenr if you have published the parameter "Read Selected Paper Spaces".

Perhaps not that straight forward but it solves the problem.


That is not possible right now (FME 2016.1) but I've solved it with a Directory & File Pathname Reader reading all dwg-files and then a StringConcatenator:

" "C:\\Program Files\\Autodesk\\AutoCAD 2016\\acad.exe" "@Value(path_windows)" /b "c:\\script.scr" "

And then send the string to a SystemCaller transformer.

The script.scr is a AutoCAD script-file that just calls a AutoCAD lisp-file inside AutoCAD and then closes the DWG-file.

The lisp-file gets the list of Paper Spaces in the DWG-file and stores it is a txt-file with the same file name as the DWG-file and in the same folder. The lisp file could look something like this:

(defun c:layoutToFile()
(setq fl (open (strcat (getvar "dwgprefix") (getvar "dwgname") ".txt" ) "w"))
(write-line (vl-prin1-to-string (layoutlist)) fl)
(close fl)
)

Then you can use the txt-files to read the Paper Spaces with a FeatureReader or with linked workspaces with the WorkspaceRunenr if you have published the parameter "Read Selected Paper Spaces".

Perhaps not that straight forward but it solves the problem.

Nice 1 @gabriel_hirsch!

 


I solved this in FME2019 maybe possible before.

Use the ACAD Reader.

Choose "Geometry" in the "Group by" section.

Choose "Read Paper Space" and ""Read Paper Space Layout Information" and nothing else.

In the Feature type selection, choose "layouts".

You'll have all the paperspace names as entities.


I solved this in FME2019 maybe possible before.

Use the ACAD Reader.

Choose "Geometry" in the "Group by" section.

Choose "Read Paper Space" and ""Read Paper Space Layout Information" and nothing else.

In the Feature type selection, choose "layouts".

You'll have all the paperspace names as entities.

Good solution! I actually didn't know that.

 

The only downside is that the layout frame comes as an geometry in your solution. I tried to elaborate your solution with a FeatureReader and tried to read only the Schema but the list FME hands me doesn't unfortunately include the name of the paper space.


Reply