Hallo @ allemaal,
Ik heb een plan van een configuratie
En een macro die de configuraties van de weergaven en de stuklijsttabel wijzigt om een PDF-plan voor elke configuratie te exporteren .
Helaas heeft elke configuratie meer of minder onderdelen en de automatische bubbels verdwijnen en verschijnen niet meer.
Heb je een aanwijzing om me te helpen, alsjeblieft


Bij voorbaat dank
Hier is mijn macro,
Ik ben geen pro op dit gebied, het is mijn tweede. En de basis van de macro komt van dit forum.
Ik probeer een macro te maken die de bubbels wist om ze te laten rusten , maar ik blokkeer.
Vriendelijke groeten
macro_pdf_enregistrer_sous-2.swp
Hallo
U kunt de AutoBalloon5-functie gebruiken
Let op: controleer voordat je begint met coderen of het handmatig werkt met de Auto_Balloons functie
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim vNotes As Variant
Dim autoballoonParams As SldWorks.AutoBalloonOptions
Dim boolstatus As Boolean
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.ActivateView("Drawing View1")
boolstatus = Part.Extension.SelectByID2("Drawing View1", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)
Set autoballoonParams = Part.CreateAutoBalloonOptions()
autoballoonParams.Layout = swBalloonLayoutType_e.swDetailingBalloonLayout_Top
autoballoonParams.ReverseDirection = False
autoballoonParams.IgnoreMultiple = True
autoballoonParams.InsertMagneticLine = True
autoballoonParams.LeaderAttachmentToFaces = True
autoballoonParams.Style = swBS_Circular
autoballoonParams.Size = swBF_5Chars
autoballoonParams.UpperTextContent = swBalloonTextItemNumber
autoballoonParams.Layername = "-None-"
autoballoonParams.ItemNumberStart = 1
autoballoonParams.ItemNumberIncrement = 1
autoballoonParams.ItemOrder = swBalloonItemNumbers_DoNotChangeItemNumbers
autoballoonParams.EditBalloons = True
autoballoonParams.EditBalloonOption = swEditBalloonOption_Resequence
vNotes = Part.AutoBalloon5(autoballoonParams)
End Sub
1 like
Dank je wel JeromeP,
Ik wilde dit doen, maar ik moet beginnen met het wissen van de bubbels die op hun plaats zijn, omdat ik een lus heb die alle configuraties maakt.
en daarvoor was ik van plan om "Part.Extension.SketchBoxSelect" te gebruiken, maar ik ben nieuw voor macro in SW en ik blokkeer snel.
Vriendelijke groeten
Alle ballonnen van een blad wissen
Option Explicit
Sub Main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim swNote As SldWorks.Note
Dim swAnn As SldWorks.Annotation
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
If swModel.GetType <> swDocumentTypes_e.swDocDRAWING Then
MsgBox "Ouvrir un dessin", vbOKOnly + vbInformation
Exit Sub
End If
Set swDraw = swModel
Set swView = swDraw.GetFirstView
swModel.ClearSelection2 True
While Not swView Is Nothing
Set swNote = swView.GetFirstNote
While Not swNote Is Nothing
If swNote.IsBomBalloon Then
Set swAnn = swNote.GetAnnotation
swAnn.Select3 True, Nothing
End If
Set swNote = swNote.GetNext
Wend
Set swView = swView.GetNextView
Wend
swModel.EditDelete
End Sub