Bonjour,
Je souhaite à l'aide d'une macro pouvoir suprimer la feuille2 (si elle existe) dans une mise en plan. (sw2014)
J'ai tout d'abord essayé l'enregistrment d'une macro mais cela ne fonctionne pas, puis j'ai trouvé plein de piste sur internet mais aucune ne fonctionne pour l'instant.
Voici un exemple (non fonctionel) sur 3D content central:
' Example macro with descriptions of how to add and delete Drawing Sheets. By Matthew Lorono, Copyright 2007 (fcsuper@aol.com)
' As an example, this code does not provide a usual function by itself. By using this code in any way whatsoever, the user and
' any entities which the user represents agree to hold the original author free of all liability.
' Free distribution and use of this code in other free works are welcome. If any portion of this code is used in other works, credit to
' the original author must be placed in that work in a user viewable location. All other forms of distribution (i.e., not free) are
' prohibited without the expressed written consent by the original author.
' Distributed by: http://sw.fcsuper.com
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
'Add Sheet
boolstatus = Part.NewSheet3("Bean", swDwgPaperCsize, swDwgTemplateCsize, 1, 1, False, 0, 0, 0, 0)
'Clear boolstatus for next operation (delete operation may not properly work while boolstatus = True)
boolstatus = False
'User input (so user can see what happened; not essential to the function of this macro)
MsgBox ("What's up?")
'Select Sheet
boolstatus = Part.Extension.SelectByID2("Bean", "SHEET", 0, 0, 0, False, 0, Nothing, 0)
'Delete Sheet
Part.EditDelete
End Sub
Si vous avez une idée d'avance merci.