Re: API: Getting template's sheet name?

Apr 02, 2004 0 Replies

DrawingDoc::GetSheetNames



Description



This method gets a list of the names of the sheets in this drawing.



Syntax (OLE Automation)



retval = DrawingDoc.GetSheetNames( )



Return: (VARIANT) retval Array containing the names of the sheets in this drawing


I am writing some VB code to delete several note items off a drawing's
> template programmatically. The code looks something like this... >
>
> For i = 1 To 10
> DeleteItem(Part, "DetailItem" & i & "@" & "Sheet Format1", "NOTE") > Next i
>
>
> Private Sub DeleteItem(ByVal Part As SldWorks.ModelDoc2, ByVal
> sItemName As String, ByVal sElementType As String)
>
> If Part.SelectByID(sItemName, sElementType, 0, 0, 0) Then
> Part.EditDelete()
> End If
> End sub
>
>
> My frustration is the need to hardcode the template sheet name ("Sheet
> Format1") into the item ID. Is it possible to get the template sheet
> name through the Solidworks API?
>
> * Unfortunately, the Sheet::GetTemplateName() function gets the
> template's filename and path rather than the sheet name as required > for an item ID.
>
> Thanks,
> Randy

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required