Skip to main content
Question

How to read all Paper Spaces from Acad file?

  • February 11, 2016
  • 4 replies
  • 49 views

arekpierchala
Contributor
Forum|alt.badge.img+1

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

4 replies

gabriel_hirsch
Contributor
Forum|alt.badge.img+11

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.


itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • September 16, 2016
gabriel_hirsch wrote:

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!

 


jedi121
Contributor
Forum|alt.badge.img+1
  • Contributor
  • January 5, 2021

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.


gabriel_hirsch
Contributor
Forum|alt.badge.img+11
jedi121 wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings