Example Programs

Description

Example Programs

Delete all objects - autocad vba

Submitted by timed on Tue, 12/25/2018 - 11:22

Public Sub deleteall()

Set newss = vbdPowerSet("tests")

    newss.Select acSelectionSetAll 'select all entities (no filters)
    
    For Each objEntity In newss

        objEntity.Erase

    Next
    newss.Delete 'delete the selection set object (not the entities)


End Sub

 

 

Public Function vbdPowerSet(strName As String) As AcadSelectionSet

  Dim objSelSet As AcadSelectionSet

  Dim objSelCol As AcadSelectionSets

  Set objSelCol = ThisDrawing.SelectionSets

teapot obj file structure

Submitted by timed on Sat, 09/29/2018 - 05:58

v -3.000000 1.800000 0.000000
v -2.991600 1.800000 -0.081000
v -2.991600 1.800000 0.081000
v -2.989450 1.666162 0.000000
v -2.985000 1.921950 0.000000
v -2.985000 1.921950 0.000000
v -2.981175 1.667844 -0.081000
v -2.981175 1.667844 0.081000
v -2.976687 1.920243 -0.081000
v -2.976687 1.920243 0.081000
v -2.968800 1.800000 -0.144000
v -2.968800 1.800000 0.144000
v -2.958713 1.672406 -0.144000
v -2.958713 1.672406 0.144000
v -2.957600 1.534800 0.000000
v -2.957600 1.534800 0.000000

GUI button in Python - wxpython sample

Submitted by timed on Thu, 03/29/2018 - 06:20


import  wx


#----------------------------------------------------------------------

class TestPanel(wx.Panel):
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1,
                         style=wx.NO_FULL_REPAINT_ON_RESIZE)
        self.log = log

        b = wx.Button(self, 10, "Default Button", (20, 20))
        self.Bind(wx.EVT_BUTTON, self.OnClick, b)
        b.SetDefault()
        b.SetSize(b.GetBestSize())

        
        b.SetInitialSize()  

Sound in Python Program - sample

Submitted by techrev on Mon, 01/22/2018 - 09:50


import  wx

from Main import opj

#----------------------------------------------------------------------

class TestPanel(wx.Panel):
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1)
        self.log = log

        b = wx.Button(self, -1, "Play Sound 1 (sync)", (25, 25))
        self.Bind(wx.EVT_BUTTON, self.OnButton1, b)

        b = wx.Button(self, -1, "Play Sound 2 (async)", (25, 65))
        self.Bind(wx.EVT_BUTTON, self.OnButton2, b)

checkbox in wxpython example code

Submitted by techrev on Mon, 01/22/2018 - 09:48

python sample programs

#program begin
import  wx

#---------------------------------------------------------------------------

class TestCheckBox(wx.Panel):
    def __init__(self, parent, log):
        self.log = log
        wx.Panel.__init__(self, parent, -1)

        st = wx.StaticText(self, -1, "This example demonstrates the wx.CheckBox control.")#, (10, 10))