Chr(34) not working somehow


#1

Hi there,

I’m using DeskProto to mill some insoles and creating a plugin for it. Got a problem here though. I first export my insoles as stl and then use that stl to create a ncp file.

Stl created by:

 Dim STLYES = Chr(34) & App_Path & "\DPExport\" & "customer, old, 10.10.1981" & ".stl" & Chr(34)
RhinoApp.RunScript("_-Export " & STLYES & " _enter _Detailedoptions _Advancedoptions _A 0 _S 0 _D 0.01 _E 0 _G 0 _M 0 _I 0 _enter _enter _selnone", True)

file name that rolls out = customer, old, 10.10.1981.stl
So thats good.

Now i’m trying the same with ncp:

Dim stl = App_Path & "\DPExport\" & "customer, old, 10.10.1981" & ".stl"
Dim ncp = App_Path & "\DPExport\" & "customer, old, 10.10.1981" & ".ncp"
Dim dp = Chr(34) & dplocation & " " & stl & " " & ncp & Chr(34)
RhinoApp.RunScript("_selnone _run " & dp, True)

File that i get = customer, .ncp
should have been customer, old, 10.10.1981.ncp

This is what is in my command bar:

Name of program to run: "C:\Program Files\DeskProto 5.0\Dp.exe C:\Users\Techmed\Desktop\STZManager\stzmanager\bin\debug\Settings\Export4DP.stl C:\Users\Techmed\Desktop\STZManager\stzmanager\bin\debug\DPExport\customer, old, 10.10.1981.ncp"

stl file is but I’m exporting it 2 times. So that can’t be the problem.

What am I doing wrong here? It worked a while ago.


(Dale Fugier) #2

This, too, needs to be enclosed in double-quote characters. Basically any path string that contains spaces needs surrounding.


#3

I’ve got it all in double-quotes.

"C:\Program Files\DeskProto 5.0\Dp.exe C:\Users\Techmed\Desktop\STZManager\stzmanager\bin\debug\Settings\Export4DP.stl C:\Users\Techmed\Desktop\STZManager\stzmanager\bin\debug\DPExport\customer, old, 10.10.1981.ncp"

The commandbar in rhino says the right thing:

Name of program to run: “C:\Program Files\DeskProto 5.0\Dp.exe C:\Users\Techmed\Desktop\STZManager\stzmanager\bin\debug\Settings\Export4DP.stl C:\Users\Techmed\Desktop\STZManager\stzmanager\bin\debug\DPExport\customer, old, 10.10.1981.ncp”

with the spaces etc but the created file will be customer,.ncp


#4

I’ve got the complete command double-quoted. This is because where I start deskproto there are also spaces. If I double-quote the 3 commands 1 by 1 only the first one will be running and he will miss the stl and ncp.

The weird thing is that I haven’t changed a thing and the command bar says the right ncp name but it just dont write it to that.

btw: deksproto site says: _run "C:\Program Files\DeskProto 6.0\dp.exe C:\temp\temp.stl C:\temp\toolpaths"


(Alain Cormier) #5

Hi,
Launching the process directly and adding double quotes around the file names should work.

      Dim stl = Path.Combine(App_Path, "customer, old, 10.10.1981.stl")
      Dim ncp = Path.Combine("DPExport", "customer, old, 10.10.1981.stl")
      Dim args = String.Format(" ""{0}"" ""{1}""", stl, ncp)

      Dim psi = New ProcessStartInfo(dplocation)
      psi.Arguments = args
      Process.Start(psi)

#6

That one works! Excellent. Thank you very much!