haaecono.blogg.se

Catia catscript examples
Catia catscript examples






VB/VBA level to a compilation error because VB may be unable to deal with the

#Catia catscript examples code

ISize = strParam1.GetEnumerateValuesSize()Ĭopy/pasting this piece of code in a VB project may lead, depending on your Set strParam1 = parameters1.Item("STRING") With array parameters like in the following example where we extract andĭisplay the multiple possible values of a StringParameter in VBScript or You will also have to take care of methods So, when copy/pasting samples from the documentation inĪ VB project, you will have to proceed to take care of virtual objects. When using VB, you will need a PartDocument object to use the Part property: Dim oDoc As PartDocumentįor documentation examples, we choose as much as possible a VBScript/Basic Or properties like the Part property that does not exist on the general Documentīut only on the PartDocument: Dim oPart As Part If this document is a PartDocument you can then use specific methods Set oDoc = CATIA.ActiveDocument ' returns a Document The type declared by the signature of the method: Dim oDoc As Document Script expects the variable in which the return value will be stored to be of The ActiveDocument method that returns a Document, Basic When a method returns an abstract object like The typing requirement are incompatible for Basic Script code and VB code. The following problem when recording macros in CATScript language and copy/pasting This has no impact on macros but you may still experience The CATScript language has been kept for compatibility and is processed by a vbscript scripting engine after removal of the typing informations.

catia catscript examples

Platform don't use anymore the Basic Script scripting engine on Unix platforms. Since V5R7 Dassault Systemes products based on the V5 When I try to record the conversion to a makro, the code only shows a rename and not an actual conversion.About VB, VBA, Debug, and Portability Infrastructure bundle, it made me gave up hope on this one.

catia catscript examples

The 'Superdeluxe' version of the script should turn the A_ Name Product into an Geometrical Bundle (so not a set) and add the electrical publications required to add Multibrancheables to the A_ name Bundle, but since it took me multiple emails to the Dassault helpdesk themselves to explain the difference between a geo. Thank you so much for any help you can offer! Set oChildProduct4 = oMainChildProducts.AddNewComponent("Product", "") Set oChildProduct3 = oMainChildProducts.AddNewComponent("Product", "") Set oChildProduct2 = oMainChildProducts.AddNewComponent("Product", "") Set oChildProduct1 = oMainChildProducts.AddNewComponent("Product", "") Set oMainChildProducts = oMainChildProduct.Products 'Retrieve the MainChildProduct's collection OMainChildProduct.PartNumber = "A_" & sName 'Declare the part number and name for this product.

catia catscript examples

Set oMainChildProduct = oRootChildren.AddNewComponent("Product", "") SName=InputBox("Please enter a name for the assembly", "input", "name") Set oRootChildren = oRootProduct.Products 'Retrieve the product's collection under the root product. 'Select the root document with the Product type Current code for adding the structure to the root product: Language="VBSCRIPT" I seem to not be able to define it as a collection and thus the script does not want to run anymore. When I try to replace the part that concerns the root with all kinds of definitions of Dim oSel As Product I have managed to add it to the root of the current document, but I cannot get it to add the product to the selected item. Create 4 products as children of the new A_ name product called B_ name, C_ name, etc. Create a new Product as a child of the selected product with A_ name

catia catscript examples

Then run a Macro that does the following, irrelevant of the name, level, of the selected product so the script can be used in different assemblies and it should not matter if it is the root or the child of a child of a child: I have been puzzling with CATscript for CATIA v5 and I am trying to do the following:īefore I would like to run the Macro, I would like to Select a Product out of a tree with 100's of products.






Catia catscript examples