Question about blocks

I have a block created with gear data in it and I have two dimensions with tolerances in it these tolarances are bilateral tolerances how can I put in these tolerances. I currently have a note on a note but it is realy hard to update the tolerances note without moving the underlaing note. is this the only way to do this?

Thanks Nathan

Reply to
Nathan Feculak
Loading thread data ...

You could name the notes and Edit them using a simple Macro. This is the sub I use to update the fields in a block that I created for Revisions.

Public Sub UpdateBlock(BlockName As SldWorks.BlockInstance)

BlockName.SetAttributeValue "TOP DESC", RevisionForm.Description1.Text BlockName.SetAttributeValue "TOP DATE", RevisionForm.Date1.Text BlockName.SetAttributeValue "MID DESC", RevisionForm.Description2.Text BlockName.SetAttributeValue "MID DATE", RevisionForm.Date2.Text BlockName.SetAttributeValue "BOT DESC", RevisionForm.Description3.Text BlockName.SetAttributeValue "BOT DATE", RevisionForm.Date3.Text

End Sub

Also use this to rename the note objects so you can edit them using Update Block

Function SetNoteName(NewName As String)

Dim MyNote As SldWorks.note Dim FoundMyNote As Boolean Dim SelMgr As SldWorks.SelectionMgr Dim LPCALLOUT As Callout Dim userName As String

Set swApp = Application.SldWorks Set part = swApp.ActiveDoc Set Part1 = part.Extension

' Get the selection manager class

Set SelMgr = part.SelectionManager()

' If user has selected something

If (SelMgr.GetSelectedObjectCount 0) Then

' Get the first item in the selection list

Set MyNote = SelMgr.GetSelectedObject2(1)

' If selected object is a note

If (SelMgr.GetSelectedObjectType(1) = 15) Then

' Change the name of the note

ret = MyNote.SetName(NewName)

' End if selected object was note or not

End If

Else MsgBox "There is nothing selected" End ' End if there is an object selected

End If

End Function

Hope this helps

Corey Scheich

Reply to
Corey Scheich

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.