|
CATIA V5 Programmierung : Script und Makro Beispiele
GeorgK am 22.07.2004 um 07:12 Uhr (0)
Suche Scripte und Makros als Beispiel. Gibt es gute Anleitungen zur Erstellung? Suche noch Links. http://www.caav5.com Allgemeine Seiten: http://www.lgi.ecp.fr/~moren/catia/ http://www.catiav5forum.de Grüße Georg
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Bohrungen und Senkungen
GeorgK am 16.07.2004 um 15:00 Uhr (0)
Habe mal ein Makro aufgezeichnet, wie es aussehen könnte. Komme leider aber mit der Selektion und den Abfragen nicht zurecht. Wie kann ich das machen? Danke Georg Language= VBSCRIPT Sub CATMain() Set documents1 = CATIA.Documents Set partDocument1 = documents1.Item( Part1.CATPart ) Set part1 = partDocument1.Part Set shapeFactory1 = part1.ShapeFactory Set bodies1 = part1.Bodies Set body1 = bodies1.Item( Hauptkörper ) Set shapes1 = body1.Shapes Set pad1 = shapes1.Item( Block.1 ) Set reference1 = part1.Create ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Probleme mit SelectElement in VBA
GeorgK am 20.07.2004 um 11:07 Uhr (0)
Sub CATMain () Auswahl festlegen ----------------------------------------------- Dim Was(1) Was(0) = Pad Was(1) = Line Selektion definieren und leeren --------------------------------- Dim UserSel As Selection Set UserSel= CATIA.ActiveDocument.Selection UserSel.Clear Selektion vornehmen lassen -------------------------------------- Dim E As CATBSTR E = UserSel.SelectElement(Was, Pad oder Linie wählen. , true) If E = Normal Then MsgBox(UserSel.Item(1).Value.Nam ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Txt Datei öffnen
GeorgK am 22.01.2008 um 21:56 Uhr (1)
Hallo,wie kann ich eine Txt-Datei öffnen (c: est.txt)?Um Notepad aufzurufen reicht:Catia.SystemService.ExecuteProcessus ("c:WindowsNotepad.exe")Exel-Datei:Sub CATMain()Set xlApp = CreateObject("Excel.Application")Set MyXL = GetObject(, "Excel.Application")If Err.Number 0 Then ExcelWasNotRunning = TrueErr.ClearSet MyXL = GetObject("c:Test.xls")MyXL.Application.Visible = TrueMyXL.Parent.Windows(1).Visible = TrueEnd SubVielen Dank und GrüßeGeorg
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Referenzkreis ändern
GeorgK am 23.06.2008 um 11:15 Uhr (0)
Hallo,wie kann ich alle Referenzkreise in einer Zeichnung so umstellen, dass die Umrahmung des Textes ohne Kreis ist? Von Hand: rechte Maustaste auf Referenzkreis = Eigenschaften = Register Text = UmrahmungDie Auswahl der Referenzkreise funktioniert soLanguage="VBSCRIPT"Sub CATMain()Dim drawingDocument1 As DocumentSet drawingDocument1 = CATIA.ActiveDocumentReferenzkreis ändernDim VisProperties1 As VisPropertySetDim selection1 As SelectionSet selection1 = drawingDocument1.Selectionselection1.Search "Draftin ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Referenzkreis ändern
GeorgK am 25.06.2008 um 17:01 Uhr (0)
Hallo Daniel,bei mir läuft das Makro unter V5R16 SP5 HF77 nicht. Habe mir jetzt so geholfen:Sub CATMain()Dim oDoc As DocumentDim oSel As SelectionSet oDoc = CATIA.ActiveDocumentSet oSel = oDoc.SelectionDim FontSize As DoubleoSel.Search "Drafting.Balloon;all"i = 1For i = 1 To oSel.CountSet OBallon = oSel.Item(i).Value If OBallon.FrameType catNone Then OBallon.FrameType = catNone End If OBallon.Leaders.Item(1).HeadSymbol = catFilledCircle NextoSel.ClearDim selection1 As SelectionSet Selection = oDoc. ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : CATIA Release per CATScript abfragen
GeorgK am 09.03.2010 um 12:51 Uhr (0)
Ist es auch möglich das Hotfix abzufragen?
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Drive Constraint
GeorgK am 01.06.2010 um 09:32 Uhr (0)
Hier nun der Code: Private Sub btn_select_Click() Me.Hide Dim oSel Dim sFilter(0) sFilter(0) = "Constraint" Dim oDoc As ProductDocument Set oDoc = CATIA.ActiveDocument Set oSel = oDoc.Selection oSel.Clear If oSel.SelectElement2(sFilter, "Constraint auswählen", False) = "Normal" Then Dim oCon As Constraint Set oCon = oSel.Item2(1).Value Call MsgBox("Name der Constraint:" + oCon.Name, vbInformation) txtbx_constraint = oCon.Name End If Me.ShowEnd SubPrivate Sub btn_start_Click() ...
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Icon wechseln mit Makro
GeorgK am 15.07.2010 um 17:44 Uhr (0)
Wir haben auch eine selbstentwickelte Toolbar (VB.Net) für den Aufruf der CATIA-Tools (Makro, Exe ...). Diese ist frei konfigurierbar (Icons, Text, Pfade etc.)
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Bauteile nach constraint isolieren
GeorgK am 29.07.2010 um 12:48 Uhr (0)
Hallo Bernd,den constraint selektiere ich so:Private Sub btn_select_Click() Me.Hide Dim oSel Dim sFilter(0) sFilter(0) = "Constraint" Dim oDoc As ProductDocument Set oDoc = CATIA.ActiveDocument Set oSel = oDoc.Selection oSel.Clear If oSel.SelectElement2(sFilter, "Constraint auswählen", False) = "Normal" Then Dim oCon As Constraint Set oCon = oSel.Item2(1).Value Call MsgBox("Name der Constraint:" + oCon.Name, vbInformation) txtbx_constraint = oCon.Name End If Me.ShowEnd Sub
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : Part oder Product aus Drawing öffnen
GeorgK am 08.06.2010 um 10:44 Uhr (0)
Hallo zusammen,wie kann ich ein Part oder Product aus einem Drawing öffnen? Der folgende Code funktioniert nicht immer z.B. wenn die Zeichnungsableitung von einer Szene stammt.Sub CATMain()CATIA.StatusBar = "Part öffnen, Version 1.0" Dim ReferenceComponent Set ReferenceComponent = drawingView1.GenerativeBehavior.Document.Parent CATIA.Documents.Open (ReferenceComponent.FullName)End SubWelche Möglichkeiten gibt es noch den Namen abzufragen?Danke schon malGeorg
|
In das Form CATIA V5 Programmierung wechseln |
|
CATIA V5 Programmierung : CGR umwandeln und ersetzen
GeorgK am 09.07.2012 um 14:29 Uhr (0)
Hallo zusammen,wie kann ich alle CGRs in einer Baugruppe in CATParts umwandeln und die CGR-Dateien durch die CATParts ersetzen lassen?Die Umwandlung von CGR nach Catpart funktioniert wie hier beschreiben:http://ww3.cad.de/foren/ubb/Forum133/HTML/005245.shtml#000000 Sub CATMain() sInputFile = CATIA.FileSelectionBox(".cgr-Datei auswählen", "*.cgr", CatFileSelectionModeOpen) Dim oDoc As Document Set oDoc = CATIA.Documents.Read(sInputFile) oDoc.ExportData sInputFile + ".model", "model" oDoc.CloseEnd SubVi ...
|
In das Form CATIA V5 Programmierung wechseln |