DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

PsPad interaction with DesignCAD via DcBasicCad(Debug)Run

Started by Dempsey, May 20, 2012, 07:26:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dempsey

Prl,

I use PsPad to develop my macros.

On the old forum you once published the interface that allows the initiation of running a macro on an open drawing in DesignCAD by using the keys F9 (DcBasicCadRun) or Alt-F9 (DcBasicCadDebugRun).

Right now I cannot get it to work anymore with V21.2 or V22.0; I get the attached message. I have a drawing open.

I switched from Windows XP to Windows 7 (x64) in August 2011 and as far as I remember I had it working on Windows 7; it was even part of a test I did during V22 beta.

Can you shed some light on this as the use of F9 and Alt-F9 in PsPad is very handy during macro development.

Thanks.

P.S. I even tried the reconstruct the zip file and documentation in this forum http://forum.designcad.com/index.php?topic=3373.msg18161#msg18161
Dempsey

prl

Well that's my message.  Let me dig into my Delphi files.  I'll recompile the code.

I'll need the type library from version 21.  Can you attach the Dcad21.tlb file?  Should be in the root directory of the DC 21 installation.

prl

Dempsey, I looked into this.  Never mind about the type library.  The version you have should work now. The message should only pop up if the interface gets disconnected from DesignCAD (user closes DesignCAD, DesignCAD crashes, etc.)  If disconnected, normally you just need to close the interface and within PsPad hit F9 to reload it.  If DesignCAD crashes keep in mind you may have hidden versions in memory. Always good to do a Ctrl Alt Delete to check running processes and kill the ghost DCs that are running.  Version 17 tends to die and leave partial processes still active.  

In summary, first load DC with an active drawing, then PsPad then F9 for interface.  If this isn't working, I'm not sure what is going on.


Attached is a recompiled version.  My quick tests show this works for DC versions 15 to 22.  I'm using PsPad v 4.5.2(2241).  I've changed the behavior of the interface slightly.  Since for the last several years I use two screens, I keep the code window with interface on the left monitor and DC maximized in the right one.  When working on some macro, within PsPad I hit F9 once and simply leave the BasicCAD interface up.  It no longer automatically closes after a run or debug run.  If this doesn't suit you let me know I'll attach a version that behaves like before (assuming I remember what that was).

prl


Edit:  So you know how I work, all the versions of DC that I have run the DesignCAD *.d3m files from one directory.  In other words, I only have one basicCAD folder.  

Edit again:  I recompiled the interface again.  I added a polling timer that checks to see if DesignCAD is running. If not the interface should close itself.  Also the title bar gives the status

Dempsey

Thanks prl,

I am using PsPad 4.5.4 too.

No success. With both V21.2 and V22.0 I get the same message again, but now with (v15..22) in it.

My gut feeling is that there is something not right in the registry. When I installed the official V22.0 it did not get activated when I double clicked a .dcd file. When I checked the registry there were almost 50 entries which pointed to my old v22 beta version. I uninstalled V22.0 and installed it again. Most v22 beta references were now gone.

I will reboot and start up V21.2 directly and see what happens.

Dempsey

Dempsey

Okay, rebooting did not solve the problem.

I uninstalled both V22.0 and V21.2.
Installed V21.2 and I could again execute a macro from PsPad.
Installed V22.0 and now I could not execute a macro from PsPad anymore. Does not work for V21.2 anymore either.

Did you tried it with the official V22.0 or the beta test version?

Obviously V22.0 does something bad to the registry.

DT, do you have your ears on?

Dempsey

prl

Quote from: Dempsey on May 21, 2012, 08:27:40 PM
Did you tried it with the official V22.0 or the beta test version?

No, I'm back at the beta v. 4/27/2012. Maybe we move this topic into the beta?

dcadRob

Need to register the ole server?

Go to command prompt, then in dc folder type:
Dcad22 /regserver

I think that's how it used to work.

Dempsey

(re)registering the ole server did not solve the problem.
Dempsey

js

I have not used PsPad, so my first question:  was this problem solved?
I tried to run DcBasicCADrun.exe from a subdirectory of PSPad editor and got the message:

"To use this interface DesignCAD.....neeeds to be running with an active drawing available."

I'm not sure what "available" means and I just don't get the first steps to start PSPad with DC.

DC v23.  Square 1 here.  Thanks

Dempsey

js,

The problem I was talking about had to do with installation of v22 on my system. V23 should work fine with debugging/running macros initiated from PsPad; works for me.

You cannot just run DcBasicCADrun.exe as it need parameter(s) to know what to do.

Basically start DesignCAD. Open a drawing. Next you need to start PsPad and open the macro you like to test/run. Then press F9 key and a small dialog window pops up, etc. (I assume that you have installed DcBasicCADrun.exe and hooked it into PsPad).

Sorry, I am logging off now as it is bed time in my neck of the woods. More tomorrow if needed.


Dempsey

js

Thanks Dempsey.

This will be great when I can get off square 1.  I have DcBasicCAD.exe in a sub directory under PsPad.
I spent some time looking for the "hook into" button - or something like it.  I looked in PsPad: Settings>Program Settings>KeyMap  but could not assign the .exe to a key.  I have no idea where to connect DcBasicCAD.exe to PsPad.

Thanks for your patience.  Could you explain the attachment process DcBasicCAD.exe to PsPad?
js

Dempsey

js,

Let us try it this way.

Take the zip and pdf files from this reply: http://forum.designcad.com/index.php?topic=3373.msg18161#msg18161. The documentation is so-so at best, but that is all I have; sorry. See if you can make sense of the documentation and how far you have come.

The exe in the zip file does not work with V23, but in the 3rd reply on this topic prl provided a recompiled one that should work!

I am heading for bed now, but I will have a look at how I did it in my PSPad tomorrow.
Dempsey

js

Again thanks Dempsey.  Progress and questions:

Do I need a syntax file?  PsPadBasicCADSyntax.zip
Do I need PsPadInterfaces.zip ?  or the fancy PsPadInterface_qui.zip?
I think you answered those questions previously, but when I extract the BasiccadPsPad.zip I get:
DcBasicCADRun.exe,  ...DebugRun.exe, ...Run.ini, ...Interface.png, and PsPadtoTop.exe

When I extract the PsPad BasicCad Programming May 21 2012.zip I get:
DcBasicCADRun.exe,   PsPad BasicCAD Interface.jpg,  PsPad Highlighter Settings.jpg,  PsPad Program Settings.jpg

Now, I open a DC drawing and PsPad and load a macro.  Try to hook up the DcBasicCADRun.exe from PsPad BasicCad Programming May 21 2012.zip using the graphics from the .zip. 

I can browse to the DcBasicCADRun.exe and add it to the PsPad Settings>Highlighter Settings>External Applications but I cannot change the "<not assigned>"  highlighter to BasicCAD.

It looks to me like I need some user defined highlighter named BasicCAD.  In the PsPad Settings>Highlighters Settings>Specification window the defined highlighters range from C/C++ to x86 assembly nothing named BasicCAD.  The instruction file, BasiccadPsPadnew.pdf, seems to show a user defined highlighter with Design Cad commands: A_Constant.. CA_Radius etc. 

And at this point I'm stuck.  I'm pretty sure I need to define a highlighter named BasicCAD.  I don't know how to do that task.




Dempsey

js,

I am back at the PC, working through the whole process of adding BasicCAD to PSPad, and creating a new zip file plus documentation.

I will be back.
Dempsey

Dempsey

js,

Have a look at http://forum.designcad.com/index.php?topic=5261.0 for the new zip file with all the required files and new documentation.

I appreciate your success/fail feedback as you are the first user.
Dempsey