|
CATIA V5 Programmierung : Flexible/ Rigid SubAssembly
JuPaV am 11.11.2010 um 15:32 Uhr (0)
Hallo! Antwort laut: flexible Unterbaugruppe kann nicht fixieren.Hier ist ein Beispiel:Sub CATMain()Set oProd = CATIA.ActiveDocument.ProductSet Constrs = oProd.Connections("CATIAConstraints")For i = 1 To oProd.Products.Count sVaterName = oProd.Name sUnterProdName = oProd.Products.Item(i).Name sRefName = sVaterName & "/" & sUnterProdName & "/!" & sVaterName & "/" & sUnterProdName & "/" Set oRef = oProd.CreateReferenceFromName(sRefName) On Error Resume Next Set Constr = Constrs.AddMonoEltCst(catCstTyp ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Bodies mit zugewiesenem Material in einem CATProduct finden
JuPaV am 24.11.2010 um 17:28 Uhr (0)
Hallo! Versuch so:Sub CATMain()Set osel = CATIA.ActiveDocument.Selectionosel.Search "Part Design.Body;all"Dim mColBody As New CollectionIf osel.Count 0 Then For i = 1 To osel.Count mColBody.Add osel.Item(i).Value NextEnd Ifosel.ClearIf mColBody.Count 0 Then For ii = 1 To mColBody.Count osel.Clear osel.Add mColBody.Item(ii) osel.Search "(CATProductSearch.MatMaterialType + CATAsmSearch.MatMaterialType),sel" If osel.Count 0 Then MsgBox "MATERIAL" Else MsgBox "keine MATER ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Element einer Publikation tauschen
JuPaV am 11.11.2010 um 16:44 Uhr (0)
Hallo! Der SetDirect-Befehl funktioniert, aber „ReplaceElement“ muss Reference sein.Beispiel:Sub CATMain()Set oProd = CATIA.ActiveDocument.GetItem("Part1")Set RefLine1 = oProd.CreateReferenceFromName("Part1/!Line.1")Ref Line.1Set publications1 = oProd.PublicationsSet publication1 = publications1.Add("Line.1")publications1.SetDirect "Line.1", RefLine1 Public Line.1Set RefLine2 = oProd.CreateReferenceFromName("Part1/!Line.2") Ref Line.2publications1.SetDirect "Line.1", RefLine2 Replace Public Element Line.2 ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Unterelemente von Achsensystem veröffentliche
JuPaV am 11.11.2010 um 10:48 Uhr (0)
Hallo!Hier ist ein Beispiel:Sub CATMain()Set oPart = CATIA.ActiveDocument.PartSet ASystems = oPart.AxisSystemsSet ASystem = ASystems.Item("AS_Part1")Set ModelElement = ASystem.GetItem("ModelElement")sInternalName = ModelElement.InternalName "GeburtsName" Axis SystemMsgBox sInternalNameEnd Sub------------------Mit freundlichen Grüßen,JuPaV
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Verdeckte Parameter löschen
JuPaV am 12.11.2010 um 12:17 Uhr (0)
Hallo! Versucht so:Sub CATMain()Set aDoc = CATIA.ActiveDocumentSet selection3 = aDoc.Selectionselection3.Search "(CATKnowledgeSearch.Set of parameters),all" If selection3.Count 0 Then Set params = selection3.Item(1).Value If params.AllParameters.Count 0 Then For i = 1 To params.AllParameters.Count Set param = params.AllParameters.Item(i) If param.Hidden Then param.Hidden = False End If Next End If selection3.Delete selection3.Clear Else If sele ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Catia V5 - 3D-Linie mittels VBA strichelen und einfärben
JuPaV am 16.11.2010 um 16:35 Uhr (0)
Hallo! Das ist einfach:CATIA.ActiveDocument.Selection.Add Line line SelectionSet visProperties1 = CATIA.ActiveDocument.Selection.VisProperties visProperties1.SetRealColor 0, 128, 0, 1 FarbevisProperties1.SetRealLineType 4, 1 Line TypevisProperties1.SetRealWidth 4, 1 Dick Line------------------Mit freundlichen Grüßen,JuPaV
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Ausblenden des Achsenkreuzes für Screenshot
JuPaV am 06.12.2010 um 17:31 Uhr (0)
Hallo! Das ist einfach.Code:------------------------Sub CATMain()Set osel = CATIA.ActiveDocument.SelectionSet VisPropSet = osel.VisPropertiesosel.Search "((((CATStFreeStyleSearch.AxisSystem + CATPrtSearch.AxisSystem) + CATGmoSearch.AxisSystem) + CATSpdSearch.AxisSystem) & Visibility=Shown),all"VisPropSet.SetShow 1End Sub------------------------------------------Mit freundlichen Grüßen,JuPaV
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Join einfärben
JuPaV am 08.12.2010 um 13:58 Uhr (0)
Hallo! code:-----------------------CATIA.ActiveDocument.Selection.Add Join line SelectionSet visProperties1 = CATIA.ActiveDocument.Selection.VisPropertiesvisProperties1.SetRealColor 0, 128, 0, 1 FarbevisProperties1.SetRealLineType 4, 1 Line TypevisProperties1.SetRealWidth 4, 1 Dick Line-----------------------------------------Mit freundlichen Grüßen,JuPaV
|
In das Form CATIA V5 Programmierung wechseln |
 |
CATIA V5 Programmierung : Join einfärben
JuPaV am 08.12.2010 um 16:28 Uhr (0)
code:------------------------------------Sub CATMain()Set oPart = CATIA.ActiveDocument.PartSet HBodies = oPart.HybridBodiesSet HB = hybridBodies1.Item("Geometrical Set.1")Set HShapes = HB.HybridShapesSet Join_ = HShapes.Item("Join.1")Dim Selection1 As SelectionSet Selection1 = CATIA.ActiveDocument.SelectionSelection1.ClearSelection1.Add Join_Selection1.VisProperties.SetRealColor 0, 100, 255, 1End Sub-----------------------------------------------------------Mit freundlichen Grüßen,JuPaV
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Bohrungsabstand
JuPaV am 13.04.2011 um 10:38 Uhr (0)
Hallo spidermat! Code:Sub CATMain()Set odoc = CATIA.DocumentsSet oPart_01 = odoc.Item("Part1.CATPart").PartSet oBody_01 = oPart_01.MainBodySet oHole_01 = oBody_01.Shapes.Item("Hole.1")Set GeoElements = oHole_01.Sketch.GeometricElementsSet oPoint_01 = GeoElements.Item("Point.1") point Part.1Set oref_01 = oPart_01.CreateReferenceFromObject(oPoint_01) Reference Point.1Set oPart_02 = odoc.Item("Part2.CATPart").PartSet oBody_02 = oPart_02.MainBodySet oHole_02 = oBody_02.Shapes.Item("Hole.1")Set GeoElements = ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : flexible Komponente
JuPaV am 20.04.2011 um 10:30 Uhr (0)
Hallo! Code:Sub Main()Komponent Selektion dannCATIA.DisplayFileAlerts = False CATIA.StartCommand ("Flexible/Rigid Sub-Assembly")End Sub------------------Mit freundlichen Grüßen,JuPaV
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Relationsets erzeugen
JuPaV am 29.06.2011 um 08:57 Uhr (0)
Hallo! Die die Umrennung der Sets geht so.Code:Sub CATMain()Set oDoc = CATIA.ActiveDocumentSet partDoc = oDoc.PartSet oPara = partDoc.ParametersSet oRel = partDoc.Relations Erzeugen des Relation-Sets unter dem ersten Geo-SetoRel.CreateSetOfRelations (partDoc.HybridBodies.Item("Geometrical Set.4")) Erzeugen des Relation-Sets unter RelationsoRel.CreateSetOfRelations (oRel.GetItem("Relations"))Set osel = CATIA.ActiveDocument.Selectionosel.Search "CATKnowledgeSearch.AdvisorRelationSet,all"If osel.Count 0 The ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Öffnen der Toolbox
JuPaV am 04.07.2011 um 15:41 Uhr (0)
Hallo! Du hast vergessen, Skizzen erzeugen.Code:Sub Konstruktion()Dim BauteilDim DokumentSet Dokument = CATIA.Documents.Add("Part")Set Bauteil = Dokument.PartDim SkizzenSet Skizzen = Bauteil.MainBody.SketchesSet UrsprungsElemente = Bauteil.OriginElementsSet Ebene = UrsprungsElemente.PlaneYZSet Skizze = Skizzen.Add(Ebene)Skizze erzeugen.Set Factory2D = Skizze.OpenEditionDim KreisSet Kreis = Factory2D.CreateClosedCircle(X, Y, r)Skizze.CloseEditionBauteil.UpdateEnd Sub------------------Mit freundlichen Grüße ...
|
In das Form CATIA V5 Programmierung wechseln |