Zdeňkovo poznámky

Co zjistím a opakovaně vyheldávám, tak sem zapíšu

Uživatelské nástroje

Nástroje pro tento web


inventor:ilogic

Rozdíly

Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.

Odkaz na výstup diff

Obě strany předchozí revizePředchozí verze
Následující verze
Předchozí verze
inventor:ilogic [2021/07/16 19:17] – [Polotovar] Zdeněk Havlíkinventor:ilogic [2025/01/09 13:27] (aktuální) Zdeněk Havlík
Řádek 1: Řádek 1:
 ====== iLogic ====== ====== iLogic ======
 +===== Form + save iproperties =====
 +<file vbscript form_save_iprop.iLogicVb>
 +'https://forums.autodesk.com/t5/inventor-programming-ilogic/change-iproperties-using-form/m-p/11307387#M140420
 +Public Sub Main()
 + Dim oDrawDoc As DrawingDocument = ThisDoc.Document
 + Dim oName As String = "MyPart.ipt"
 +
 + '//////// RUN THE FORM ////////
 + Dim oForm As New WinForm(iLogicVb.Automation, oDrawDoc)
 + oForm.ShowDialog()
 +
 + iProperties.Value(oName, "Project", "Part Number") = oForm.NewPartNumber
 +
 + oDrawDoc.Update
 +End Sub
 +
 +Public Class WinForm
 + Inherits System.Windows.Forms.Form
 + Public Property oDrawDocint As DrawingDocument
 + Public Property oTextBox As New System.Windows.Forms.TextBox
 +
 + '//////// CREATE NEW INSTANCE ////////
 + Public Sub New(ByVal Iinf As IiLogicAutomation,oDrawDoc As DrawingDocument) 
 + oForm = Me
 + myIinf = Iinf
 + oDrawDocint = oDrawDoc
 +
 + '//////// PARAMETERS FOR THE FORM ////////
 + With oForm
 + .FormBorderStyle = FormBorderStyle.FixedToolWindow
 + '.StartPosition = FormStartPosition.CenterScreen
 + .Width = 250
 + .Height = 300
 + .Font = oLargerFont
 + End With
 +
 + '//////// CREATES THE BUTTON ////////
 + Dim oButton1 As New System.Windows.Forms.Button()
 + With oButton1
 + .Text = "ACTION"
 + .Top = ((oForm.Bottom - oForm.Top)/2) - (oButton1.Bottom - oButton1.Top)
 + .Left = (oForm.Width/2) - oButton1.Width +20
 + .Enabled = True
 + .AutoSize = True
 + End With
 +
 + Dim oLbl As New System.Windows.Forms.Label
 + With oLbl
 + .Text = "MyPart"
 +     .Top = 20
 +     .Left = 20
 +     .Height = 40
 + End With
 +
 + With oTextBox
 + .Text = "Part No."
 + .Top = 20
 + .Left = 120
 + .Width = 100
 + .Height = 25
 + End With
 +
 + oLbl = oForm.Controls.Add(oLbl)
 + oForm.Controls.Add(oTextBox)
 + oForm.Controls.Add(oButton1)
 + AddHandler oButton1.Click, AddressOf oButton1_Click
 + End Sub
 +  
 +  Public Property NewPartNumber As String
 +   
 + Public Sub oButton1_Click(ByVal oSender As System.Object, ByVal oEventArgs As System.EventArgs)
 + NewPartNumber = oTextBox.Text
 + Me.Close()
 + ' iProperties.Value(oName, "Project", "Part Number") = oTextBox.Text
 + End Sub
 +End Class
 +</file>
 +
 ===== Polotovar ===== ===== Polotovar =====
-<file php myexample.php+ 
-<?php echo "hello world!"; ?>+<file vbscript Polotovar.iLogicVb> 
 +'From https://www.cadlinecommunity.co.uk/hc/admin/articles/203069922 
 +Try 
 + 'oHoldingPositionName = InputBox("Specify the    N A M E    of the new iProperty", "Cadline Community - iProperty Name", "New"
 + oValue = InputBox("Specify the    V A L U E    of the new iProperty", "Cadline Community - iProperty Value", "1"
 + 'iProperties.Value("Custom", oHoldingPositionName) = oValue 
 + 'iProperties.Value("Custom", "POLOTOVAR") = oValue 
 + iProperties.Value(ThisDrawing.ModelDocument.DisplayName,"Custom", "POLOTOVAR") = oValue 
 +Catch 
 + 
 +End Try 
 +</file> 
 + 
 +<file vbscript zzz_Polotovar.iLogicVb> 
 +If ThisApplication.ActiveDocument.DocumentType <> kDrawingDocumentObject Then 
 + MessageBox.Show("Prosím, spustě toto pravidlo nad VÝKRESem", "iLogic"
 + Exit Sub 
 +End If 
 + 
 +'MessageBox.Show("Bylo spuštěno nad výkresem, DĚKUJI", "iLogic"
 + 
 +Try 
 + oValue = InputBox("Zadej polotovar", "AUTOMA - polotovar", iProperties.Value(ThisDrawing.ModelDocument.DisplayName,"Custom", "POLOTOVAR")) 
 + iProperties.Value(ThisDrawing.ModelDocument.DisplayName, "Custom", "POLOTOVAR") = oValue 
 + ThisDoc.Document.Update 
 +Catch 
 + 
 +End Try 
 + 
 +'Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument 
 +'Dim oDrawParams As UserParameters = oDrawDoc.Parameters.UserParameters 
 + 
 +'Dim TestParam As UserParameter = oDrawParams.AddByValue("TestParam", "InitialValue", UnitsTypeEnum.kTextUnits) 
 +</file> 
 + 
 +<file vbscript poznamky_nad_razitko.iLogicVb> 
 +'iLogic code by Clint Brown @ClintBrown3D 
 +'Originally posted at https://clintbrown.co.uk/Drawing_Notes_iLogic 
 + 
 +SetNotePath = "C:\TEMP\Notes.txt" 
 + 
 +' This assumes a drawing document is active. 
 +Dim oDrawDoc As DrawingDocument 
 + oDrawDoc = ThisApplication.ActiveDocument 
 + 
 + a reference to the active sheet. 
 +Dim oActiveSheet As Sheet 
 + oActiveSheet = oDrawDoc.ActiveSheet 
 + 
 + a reference to the GeneralNotes object 
 +Dim oGeneralNotes As GeneralNotes 
 + oGeneralNotes = oActiveSheet.DrawingNotes.GeneralNotes 
 + 
 +Dim oTG As TransientGeometry 
 + oTG = ThisApplication.TransientGeometry 
 + 
 +'----------READ IN DATA From TEXT File -------------------- 
 +oRead = System.IO.File.OpenText(SetNotePath) 
 +EntireFile = oRead.ReadToEnd() 
 +oRead.Close() 
 +Dim sText As String  
 +sText = EntireFile  
 +'----------READ IN DATA From TEXT File -------------------- 
 + 
 +Dim oGeneralNote As GeneralNote 
 +'oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(3, 40), sText) 'Top Left 
 +'oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(50, 40), sText) 'Top Right 
 +oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(50, 8), sText) 'Bottom Right 
 +'oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(3, 6), sText) 'Bottom Left
 </file> </file>
 +
 + MessageBox.Show("Opravené pravidlo: " & RuleName, "Informace")
 + Dim objSPVoice,colVoices
 + objSPVoice = CreateObject("SAPI.SpVoice")
 + objSPVoice.speak ("gate ley you fucked up again fill in that i property")
 + objSPVoice.speak ("i am facking awsome")
 +
inventor/ilogic.1626463044.txt.gz · Poslední úprava: 2021/07/16 19:17 autor: Zdeněk Havlík

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki