0

I'm trying to do some automation in OrCAD Capture using its Tcl scripting interface. I've run into a problem of receiving a struct, but not having any exposed functions to deal with it. I know the structure of the struct (it's a LOGFONT) so is there anyway to unpack the struct?

I've found SWIG that allows creating Tcl interfaces to C libraries. I'd really rather not have to ship C code just to access a simple struct though!

Ryan Fox
  • 10,103
  • 5
  • 38
  • 48

1 Answers1

1

This is really the kind of thing you need to be asking your product vendor about. Searching doesn't turn up much useful information, although several posts on Cadence forums seem to indicate that the documentation you need is in a file named "OrCAD_Capture_TclTk_Extensions.pdf", (look in instdir/tools/capture/tclscripts/). Also, _60e6d70d_p_LOGFONT is an object handle. It looks like it's a command... So, set $logfont [command_that_returns_this_handle], and then $logfont will be the command to invoke object methods, which should be documented in "OrCAD_Capture_TclTk_Extensions.pdf".

This was the sense that I extracted from http://www.cadence.com/Community/forums/p/15614/1294051.aspx. See for yourself.

This isn't my real name
  • 4,869
  • 3
  • 17
  • 30
  • I've been working extensively from OrCAD_Capture_TclTk_Extensions.pdf, I can get a handle to a LOGFONT from a DboCommentText object, but I haven't found any functions to retrieve information from within the LOGFONT object. (Facename, styles, orientation, etc.) Since it's just a struct, and I know the offsets of all of the fields, I'm wondering if there's any native Tcl method of accessing the data. – Ryan Fox Aug 29 '13 at 20:17
  • If the handle isn't a command, (what happens if you try to treat it as one?), I don't believe you can do it in pure Tcl. I'm not aware of any pure-tcl method for getting the content of arbitrary memory locations. However, the twapi extension might have an answer, as it provides tcl command wrappings for the win32 API. – This isn't my real name Aug 29 '13 at 20:43