Pulsonix User Forum

Technical advice from Pulsonix engineers and the wider community.

 All Forums
 Help with using Pulsonix
 Scripting
 PlotWriter Pathing

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON

   Upload a file

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
HarryHirn Posted - 29 Aug 2017 : 09:55:46
Hi,

i am trying to plot from a script but for me the PlotWriter() seems to behave not like described in the documentation.

I want to put the plots in a specific folder.

My script:


var Design = ActiveDocument();
 if (Design) {
     var PlotWriter = Design.NewPlotWriter();
     if (PlotWriter) {
         PlotWriter.WriteDevicePlots('PDF', 'Test/');
     }
 }


I get the following warning:
"File Test/Design1_.pdf is locked"

The Folder "Test" does not appear on my computer.

Changing the script to


 var Design = ActiveDocument();
 if (Design) {
     var PlotWriter = Design.NewPlotWriter();
     if (PlotWriter) {
         PlotWriter.WriteDevicePlots('PDF', '/Test/');
     }
 }


Produces a folder one level above.

expected:
D:/Pulsonix/Test/Design1_.pdf

reality:
D:/Test/Design1_.pdf


Changing the script to:


 var Design = ActiveDocument();
 if (Design) {
     var PlotWriter = Design.NewPlotWriter();
     if (PlotWriter) {
         PlotWriter.WriteDevicePlots('PDF', '../Test/');
     }
 }


Produces the folder
D:/Pulsonix/Test

but there is only the Design1(CAMPlot).txt report.

For me the folder relative path is wrong, it doesnt behave like in the documentation.

Am i missing something?
2   L A T E S T    R E P L I E S    (Newest First)
steve Posted - 29 Aug 2017 : 11:30:08
Logged as 43104.

Pulsonix Assistance
psxforum Posted - 29 Aug 2017 : 10:58:16
I have tried the examples you show, and it seems to me that the application is trying to place the output file relative to what it considers to be the 'current' folder rather than the folder in which the design file exists.

I can get it to work fine by specifying a full rather than relative path, but of course that is not what you require as you want your output file to be placed relative to the location of the design file.

I will log this on our support database to be investigated and fixed.

David.