The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 calling pe_mkdir via LabTalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

oricom

Belgium
Posts

Posted - 08/31/2006 :  06:52:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I am calling origin via com automation (from python)
Normal LabTalk commands work, while the extended commands like
pe_dir, pe_mkdir and pe_cd fail
If I enter these commands into the command window of my com server session, they fail with a command error, during a normal origin session they work.

import win32com.client as w32
origin=w32.Dispatch("OriginApplication")
origin.Execute("doc -mc 1")
# this works
origin.Execute("win -t data MASTER Name")
# this fails
origin.Execute("pe_mkdir(\"a\")")
# if I enter pe_mkdir(a) into the now running session, I get a command error.


Origin Version 7.5:
Operating System: XP


many thanks

Frank

zachary_origin

China
Posts

Posted - 08/31/2006 :  12:58:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am not familiar with python.
But I tried to the following scripts in PyWin32 build 209.1 and Python 2.5, it works well.

import win32com.client as win32
origin=w32.Dispatch("Origin.Application")
#is there any difference between OriginApplication and Origin.Applicaiton? Using the former, I can not open Origin.
origin.Execute("doc -mc 1")
origin.Execute("win -t data MASTER Name")
origin.Execute("pe_mkdir(\"a\")")

Origin 7.5 & OS:XP sp2

Zachary
OriginLab GZ Office
Go to Top of Page

oricom

Belgium
Posts

Posted - 09/01/2006 :  06:46:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Zachary,


thank you for your fast reply and for doing the test install.
I think I located the problem outside of the com interface.
If I run the code it still doesn't work, neither from python nor from the script window.
If I open the Code Builder, select LT_PE.C and RebuildAll both work (I instantaniated OriginApplicationSI to try this, sorry for the typo in Application in my last post).

So it seems on starting the COM server, LT_PE.C is not linked
I tried to manually load the file, but failed:
err=run.loadOC("OriginLab\LT_PE.C");
err=;
ERR=4
pe_dir();
#Command Error!
after pressing the build button pe_dir() works, as if origin was run from the start menu.

LT_PE.C is in the System folder, so it should be available automatically on startup?


Thanks

Frank


Go to Top of Page

zachary_origin

China
Posts

Posted - 09/03/2006 :  10:54:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Really strange. By default all the .c files under the system folder of Origin are autocompiled as Origin application is launched. LT_PE.C is also compiled without exception.

When ran the scripts you provided, I got the results as followings:

err=run.loadOC("OriginLab\LT_PE.C");
err=;
ERR=0
pe_dir();
Data1

I have tested the scripts in several computers, it works for all.

So can you tell me the build of your Origin? You can get it by >Selecting Help:About Origin or >type @v= in command window.



Zachary
OriginLab GZ Office
Go to Top of Page

oricom

Belgium
Posts

Posted - 09/04/2006 :  09:21:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Zachary,

I did a new install with version 7.5885,
this works without problems.


many thanks for your help!


Frank
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000