cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Possible to script insert of OLE object Excel file in Creo drawing?

egifford
4-Participant

Possible to script insert of OLE object Excel file in Creo drawing?

I'm trying to create a mapkey to insert an Excel file in a Creo 2.0 drawing using the insert, object function (OLE).  The problem is it stalls as soon as the Insert Object interface comes up.  Trying to capture it within and run a trail file does the same thing (trail file stops at the same place & doesn't capture the inputs into the Insert Object box).  I also tried accomplishing this by creating a source drawing with the Excel OLE object already inserted and using a mapkey to open that drawing, copy the OLE object and paste it into the destination drawing.  This works, but with a major catch.  Within a session, any drawings to which the OLE object is pasted are actually linked in the background such that changing the OLE inserted excel table in one drawing applies the same change to the table in all the drawings.

 

Anyone have any suggestions on scripting the insert object function?

 

Overall goal is to have a table on a drawing that autonumbers the rows as they are added, has a "CC" code box which is limited to the numbers 1-5, ideally with a pick dropdown for the users, and a text reason code which has an association to the CC code . . e.g. CC #1 = Reason text AAA, CC #2 = Reason text BBB etc   I want to eliminate the reason from being typed in ( make it a fixed list) to prevent typos and personal takes on the wording, and have an association between the CC code and reason text to prevent mismatches.  I did all this in the Excel file, works great, but want to package the insert of the Excel file OLE object down to a button click for the user.

 


KPC_table.JPG

 

Regards,

 

Erik Gifford

GW Lisk Co., Inc.

 

Creo Parametric 2.0 M190

Windchill PDMLink 10.0 M030


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2
dnordin
15-Moonstone
(To:egifford)

Erik,

Have you considered using AutoIT to fill in the Insert Object dialog box?  I've used it successfully to enter data in the Creo Parametric dialog boxes.

Another option, if you want the users to select via a drop down, would be to use restricted value parameters as well as relations to drive the other parameter values.  You could then just build a regular table to display the data on the drawing.  You might be able to use global parameters for even more control.

Check out https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS51011 for info on restricted value parameters.  The file format is a bit odd, but once you get it down, it works fine.

Regards,

Dan N.

egifford
4-Participant
(To:dnordin)

  Dan,

 

  Yeah, we use restricted parameter lists for other scenarios.  The issue in this case is a model and corresponding drawing would typically have several dimensions and sometimes a note or two that would describe something considered a KPC.  Each of these KPC’s would have a sequentially numbered line entry on the table with a corresponding CC number and associated Reason text.  So each of these items would have to have a parameter associated, with the restriction list driving the CC to be 1-5 and the Reason code driven by a relation to auto-populate the text based on the CC code.  We’re looking into some custom programming to achieve this and long run, it could be a better solution if it drives the info back into the model (rather than a table that just exists on the drawing).  For now we’ll use the Excel table and users will have to manually add the table OLE object rather than have the simplicity of a mapkey that does all the work with one click.

  Erik

Top Tags