top of page
Search
stanislavb12m9

Catia V5 in Interfaces Object Library: What You Need to Know About the CATIA V5 Automation API



Another thing to look into - I don't have an object librarycalled "INFInterfacesTLB" as an option in myreference library, but I do have CATIA V5 infInterfaces ObjectLibrary. Perhaps just removing that as a reference will fix theissue?


Then, automation interfaces for the new feature and its factory are written using the IDL language, and appropriate dictionary declaration is produced. Some more additional IDL code gathers those new IDL objects definitions within a source code TypeLib, which is compiled into an executable TypeLib that will be used by scripting languages for knowing about those new types at run time.




catia v5 in interfaces object library




The last part consists in implementing the new IDL interfaces in the underlying model. In addition to the methods defined in the interfaces themselves, the implementations must provide code for methods get_Name() and get_Parent(), that all automation objects must implement. Thanks to get_Parent(), the exposed automation model can appear as having a parent-child structure which is somehow different (and most often, simpler) than the one existing in the underlying model.


If you want to use early binding for the CATIA V5 object libraries you can use the Makepy utility from Pythonwin. After that every object and its methods will be usable from the pulldown menu of Pythonwin while typing and you can have a performance advantage. You should use makepy for every object library which you want to use e.g. "ProductStructure Object Library" for working with CATProducts). But not for the "CATIA V5 Interfaces Objekt Library"!


  • The CAA V5 IDL uses the following object types (the definitions are those ofCORBA if they exist): The interfaces: an interface is a set of possible operations that a client may request of an object. It is converted into C++ as a class that contains no data members, but only methods.

  • The types: a type is an identifiable entity with an associated predicate (a single-argument mathematical function with a boolean result) defined over values. Types can be basic types, such as integer or float, and constructed type such as structure or interface.

  • The operations: an operation is an identifiable entity that denotes a service that can be requested

  • Some lexical conventions are required by IDL to accommodate mapping forseveral programming languages: Two objects can not have their identifiers which differ only by casing since upper-case and lower-case characters are treated as the same character

  • A object identifier must be consistently spelled as declared, with respect to case

  • The same identifier can not be used for two objects, such as an interface and a constant

  • IDL keywords are not allowed as identifiers

  • Operators, such as =, +, and so forth can not be overloaded

  • An identifier can not begin using the _ character (underscore). This prevents from colliding with C++ names in the generated code. Check that the C++ code you write does not contain such _ characters.

Remind also that any object declaration must be located beforeusing it.


To provide type information at run time for the scripts, Microsoft COM offersthe type library, which does not exist with CORBA. This makes it possible forthe interpreted language to access the methods by means of the virtual functiontable of the object and to ensure run time type checking like C++ run time does.In addition, it is much faster than the late binding. The type library is acompiled version of a set of IDL files. It contains the description of all theinterfaces, all the method prototypes, properties, and all the parameters theyrequire along with their types.


  • where: INFITF is the type library name

  • CATIApplication.idl, CATIPageSetup.idl and CATIWindow.idl the files containing the interfaces

  • REPID, REPBEGIN and REPEND are keywords to declare respectively the type library name and its GUID, the beginning and the end of the interfaces to include in the type library

  • REPREQ declares the prerequisite type libraries.

The IDL compiler builds the run time type library from such a source file andstores it in a shared library with UNIX or a DLL with Windows.


SAP Engineering Control Center interface to ECAD effectively supports development in electronic design and enables the integration of leading ECAD tools into SAP. Engineers can manage and classify electronic design data directly from their familiar authoring environment in SAP and link them for example with MCAD documents or SAP objects (library parts with material and so on). Apart from that, engineering change management functions, status log and status networks offer safe versioning and transparent monitoring. Many processes run automatically: from creating bills of material and where-used lists to generating production records such as Gerber data and assembly diagrams.


  • CATIA V5 is a powerful tool in the CAO field. With some work you could be able to design almost everything. But how many time will you need, for example, to create ALL screws in your assembly ? With each type ? Each diameter ? Hopefully a tool named VBA exist to get rid of this waste of time. I will present you the very basics applications of using VBA macros with CATIA V5.First of all CATIA V5 can be piloted with mainly three possible languages :Visual Basic

  • VBA

  • CATScript

  • I choosed to use VBA for a simple reason : It allows me to use easyly Excel to pilot CATIA. That's mean I could use datasheets or graphics to create Parts in CATIA V5. Moreover it offers a better interface with the user (command button, listbox...) and a priceless programming help (automatical completion, help to find errors). However VBA has disavantages like a weak protection and it could be difficult to export VBA macros.I suppose in the following that you have some prerequisites in VBA. If not, you can look at this article which present briefly VBA for Excel. If it's not enough, you can find plenty of tutorials in Internet.Before beginning I introduce your new best friend : the CATIA help. It's very dense and complexe but it should be your reference. You find it here : \Catia_V5\intel_a\code\bin\V5Automation.chm. I suggest you to make immediatly a shortcut on your desktop.1) CATIA V5 OLE (Object Linking and Embedding)If you want to have an interactive review in Word for example, you can use the link between CATIA and Word : just drag and drop a CATPart on your word document and you have a picture of your part. Double-click on it and you can edit it in CATIA V5 (Figure 1).Picture 1 : OLE operation2) IN- and OUT macrosa) IN process applicationYou have two choices to pilot CATIA.First you can use the Visual Basic Editor included in CATIA V5 (TOOLS\MACRO\Visual Basic Editor Picture 2)You create this way IN process application.Picture 2 : Run the VB EditorYou have the same Macro menu as in VBA Excel where you can see all the macro you have writed. You can run, edit, rename or delete this macro. You can also record a macro if you have a specifical need or when you did'nt remember the right syntax. Then you can find it in the module name you have choosed. How to add a macro as a command in a Toolbar ?Go to Tools\customize\Commands and click on Macro. Select the macro you want and then drag and drop it in the toolbar you wish. You can also use a personalised icon if you don't like the default icon by clicking on Show Properties (Picture 3)Picture 3 : How to add a macro on your toolbarb) OUT process applicationOtherwise, you can pilot CATIA through Excel.Personnaly, I found this solution more effective for two reasons :You can use Excel datas

  • You have more freedom (VB Editor in CATIA need a CATMain sub whereas VBA in Excel didn't)

  • However you have to activate the CATIA functions, propertys and types. Just check the boxes beginning by catia in TOOL\REFERENCES (Picture 3)Picture 3 : Activate the CATIA libraries in VBA ExcelHowever, as you aren't in CATIA VB Editor, you have to declare CATIA as Object in your sub.You have two cases :If CATIA is already running

  • The GetObject function allows to set CATIA application as the object you defined.The code is so : [...]Dim CATIA As Object Set CATIA = GetObject("CATIA.Application")[...] If CATIA is not running

You have to create the object using CreateObject : [...]Dim CATIA As Object Set CATIA = CreateObject("CATIA.Application")[...] Now you are able to create your first macro, which launch CATIA if not. sub CATRun()Dim CATIA As Object 'In Error case CATIA is not already openOn Error Resume NextSet CATIA = GetObject("CATIA.Application")If Err.Number 0 Then Set CATIA = CreateObject("CATIA.Application") CATIA.Visible=TrueEnd ifOn Error GoTo 0End sub Now you're able to run CATIA V5 through Excel. Before going further you need to have a introduction to the CATIA structure.


Early-bound objects require their custom interfaces to be marshaled across process boundaries. If the custom interface cannot be marshaled during CreateObject or during New, you receive the "429" error message. A late-bound object uses the IDispatch system-defined interface that does not require a custom proxy to be marshaled. Use a late-bound object to verify that this procedure works correctly.If the problem occurs only when the object is early-bound, the problem is in the server application. Typically, you can reinstall the application as described in the "Examine the Automation Server" section of this article to correct the problem.


2ff7e9595c


0 views0 comments

Recent Posts

See All

Jogos de caminhão android

Baixar Battle of Heroes Star Wars: como jogar o jogo móvel épico Se você é fã de Star Wars, deve ter ouvido falar de Battle of Heroes...

Comments


bottom of page