Structure Design |
Creating Copings |
|
|
This macro shows you how to apply coping between structure objects. Here we will see three Cases.
|
|
|
CAAStrCreateCoping is launched in CATIA [1]. Some documents are needed.
|
|
|
CAAStrCreateCoping includes five steps:
PrologSub CATMain()
Dim StrWorkbench As StrWorkbench
Dim strFactory As StrObjectFactory
Set doc = CATIA.ActiveDocument
Dim rootProduct As Product
Set rootProduct = doc.Product
Set StrWorkbench = doc.GetWorkbench("StrWorkbench")
Dim strPlates As strPlates
Set strPlates = rootProduct.GetTechnologicalObject("StructurePlates")
Dim strMembers As strMembers
Set strMembers = rootProduct.GetTechnologicalObject("StructureMembers")
Retrieving the Factory from Object on which Coping Is to Be DoneThis step describes how to get Structure Feature Factory. The Factory object is retrieved by adding object to nibble to the selection list. 'Get The Factory from Selection Method
Dim PlateToNibble As StrPlate
Set PlateToNibble = strPlates.Item("Deck_014.2")
Dim PlateSelection As Selection
Set PlateSelection = CATIA.ActiveDocument.Selection
PlateSelection.Add PlateToNibble
Dim FactoryForPlate As StrFeatureFactory
Set FactoryForPlate = PlateSelection.FindObject("CATIAStrFeatureFactory")
Defining the LimitsThe limits are defined by adding them to list of variant which can contain only one element at a time. 'Define the Limits for PlateToNibble
Dim Limitplate1 As StrPlate
Set Limitplate1 = strPlates.Item("Shell_002.1")
Dim LimitSurface1 As Reference
Set LimitSurface1 = rootProduct.CreateReferenceFromName("Product1/Part1.1/!Extrude.1")
Dim Listoflimits1(0) As Variant
Dim Listoflimits2(0) As Variant
Set Listoflimits1(0) = Limitplate1
Set Listoflimits2(0) = LimitSurface1
Creating CopingCreate Coping by passing list of limits containing one element and Type. Coping SubType can also be defined later. 'Create Nibbling by defining Type and SubType Dim NibblingFeature1, NibblingFeature2 As StrNibblingFeature Set NibblingFeature1 = FactoryForPlate.AddNibbling(Listoflimits1, "Remove") NibblingFeature1.SubType = "ButtButt" Set NibblingFeature2 = FactoryForPlate.AddNibbling(Listoflimits2, "Remove") NibblingFeature2.SubType = "CurrCurr" Creating Coping for Case2 and Case3In Case2: we will apply coping on Member when it is limited by 2 Members and One Plate. 'Case2: When Member is limited by 2 Members and One Plate
'Get the Factory from Selection Method
Dim MembertoNibble1 As StrMember
Set MembertoNibble1 = strMembers.Item("BottShell_LStf_003.1")
Dim MemberSelection As Selection
Set MemberSelection = CATIA.ActiveDocument.Selection
MemberSelection.Add MembertoNibble1
Dim FactoryForMember As StrFeatureFactory
Set FactoryForMember = MemberSelection.FindObject("CATIAStrFeatureFactory")
'Define the Limits for MembertoNibble1
Dim L1 As StrMember
Set L1 = strMembers.Item("Shell_VStf_006.1")
Dim L2 As StrMember
Set L2 = strMembers.Item("Shell_VStf_005.1")
Dim L3 As StrPlate
Set L3 = strPlates.Item("Shell_002.1")
Dim Listoflimits3(0) As Variant
Dim Listoflimits4(0) As Variant
Dim Listoflimits5(0) As Variant
Set Listoflimits5(0) = L3
Set Listoflimits3(0) = L1
Set Listoflimits4(0) = L2
'Create Nibbling by defining Type and SubType
Dim NibblingFeature3, NibblingFeature4, NibblingFeature5 As StrNibblingFeature
Set NibblingFeature3 = FactoryForMember.AddNibbling(Listoflimits3, "WeldCut")
Set NibblingFeature4 = FactoryForMember.AddNibbling(Listoflimits4, "LongPoint")
NibblingFeature4.Type = "ShortPoint"
Set NibblingFeature5 = FactoryForMember.AddNibbling(Listoflimits5, "Remove")
In case3 we will define the extrapolation offset for the lateral face of stiffener. 'Case3: When Member is limited by Lateral Face of Plate
'Get the Factory from Selection Method
Dim MembertoNibble2 As StrMember
Set MembertoNibble2 = strMembers.Item("Deck_TStf_005.1")
Dim Member2Sel As Selection
Set Member2Sel = CATIA.ActiveDocument.Selection
Member2Sel.Add MembertoNibble2
Dim FactoryForMember2 As StrFeatureFactory
Set FactoryForMember2 = Member2Sel.FindObject ("CATIAStrFeatureFactory")
'Define the Limits for MembertoNibble2
Dim L4 As StrPlate
Set L4 = strPlates.Item("Deck_014.2")
Dim ListofLimits6(0) As Variant
Set ListofLimits6(0) = L4
'Create Nibbling by defining the Extrapolation Offset
Dim NibblingFeature6 As StrNibblingFeature
Set NibblingFeature6 = FactoryForMember2.AddNibbling(ListofLimits6, "Remove")
NibblingFeature6.GetOffsetForExtrapolate ("25mm")
|
![]()
[Top]
This use case has shown how to create coping between structure objects.
[Top]
| [1] | Replaying a macro |
| [Top] | |
Copyright © 1999-2010, Dassault Systèmes. All rights reserved.