Hello, I would like to put a text that appears on my 3D assembly every time I open it, I tried annotations/notes or comments in the feature manager tree with activation of my note but nothing appears. Thank you in advance.
Hello
Normally by default the display is disabled.
You must select these icons normally to display the annotations/notes in the ASM or Parts
Thank you @Cyril.f for this answer. So how do I make it stay by default because when I close my assembly it doesn't stay in memory. Thank you in advance.
Hello;
You should save your settings in your document templates (sldprt/sldasm).
On the other hand, for your old files, unless you reload your models, you will have to re-configure them by hand (or make a macro).
' ******************************************************************************
' Affichage tête haute : Cacher types non utilisés
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim swModelDocExt As SldWorks.ModelDocExtension
Sub main()
Set swApp = Application.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc 'Travail sur le document actif sous SolidWorks
FilePath = swModel.GetPathName ' Chemin complet du fichier
FileName = swModel.GetTitle 'Nom du fichier avec extension
Filetype = swModel.GetType 'Donne le type de document ouvert avec :0=swDocNONE;1=swDocPART;2=swDocASSEMBLY;3=swDocDRAWING
If Filetype = 1 Then 'Si le document est un document pièce...
Set Part = swApp.ActiveDoc
'Efface plans
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayPlanes, False)
'Efface axes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAxes, False)
'Efface axes temporaires
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayTemporaryAxes, False)
'Efface points
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints2, False)
'Efface systeme de coordonnées
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCoordSystems, False)
'Efface Origines
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayOrigins, False)
'Efface Systeme de references
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatumCoordSystems, False)
'Efface lignes neutres
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayPartingLines, False)
'Efface courbes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCurves, False)
'Affiche Annotations de premier niveau (Permet de visualiser les filets)
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAllAnnotations, True)
'Efface Annotations de composants
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCompAnnotations, False)
'Affiche Esquisses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySketches, True)
'Affiche cotations esquisses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swHideShowSketchDimensions, True)
'Affiches Relation esquisses
ETAT = Part.GetUserPreferenceToggle(swUserPreferenceToggle_e.swViewSketchRelations)
If ETAT = Faux Then boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewSketchRelations, True)
'Efface plans esquisses 3D
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySketchPlanes, False)
'Efface Lumieres
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLights, False)
'Efface Grille
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swGridDisplay, False)
'Efface Camera
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCameras, False)
'Efface Calques
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDecals, False)
'Efface plans de coupes interactives
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLiveSections, False)
'Efface points de routage
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints, False)
'Efface nom des cotes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swShowDimensionNames, False)
'Efface symbole centre de masses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCenterOfMassSymbol, False)
'Efface cordons de soudures
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayWeldBead, False)
'Affiche (propriété document)representation filetages
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCosmeticThreads, False)
'Efface (propriété document)References
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatums, False)
'Efface (propriété document)Cibles deReferences
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatumTargets, False)
'Efface (propriété document) Cotes de fonctions
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayFeatureDimensions, False)
'Efface (propriété document) Cotes de References
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferenceDimensions, False)
'Efface (propriété document) Cotes DimExpert
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDimXpertDimensions, False)
'Affiche (propriété document) Representation filetage Ombré
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayShadedCosmeticThreads, True)
'Affiche (propriété document) Tolerances geometriques
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayGeometricTolerances, True)
'Affiche (propriété document) Notes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayNotes, True)
'Affiche (propriété document) Etats de Surfaces
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySurfaceFinishSymbols, True)
'Efface (propriété document) Cordons de soudures
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayWeldSymbols, False)
'Efface (propriété document) Cube Visualisation
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewDispGlobalBBox, False)
'*******************************************************************************************************************************************
ElseIf Filetype = 2 Then 'Si le document est un document Assemblage...
Set Part = swApp.ActiveDoc
'Efface plans
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayPlanes, False)
'Efface axes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAxes, False)
'Efface axes temporaires
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayTemporaryAxes, False)
'Efface points
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints2, False)
'Efface systeme de coordonnées
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCoordSystems, False)
'Efface Origines
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayOrigins, False)
'Efface Systeme de references
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatumCoordSystems, False)
'Efface lignes neutres
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayPartingLines, False)
'Efface courbes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCurves, False)
'Affiche Annotations de premier niveau (Permet de visualiser les filets)
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAllAnnotations, True)
'Efface Annotations de composants
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCompAnnotations, False)
'Efface Esquisses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySketches, False)
'Efface cotations esquisses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swHideShowSketchDimensions, False)
'Efface Relation esquisses
ETAT = Part.GetUserPreferenceToggle(swUserPreferenceToggle_e.swViewSketchRelations)
If ETAT = Vrai Then boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewSketchRelations, False)
'Efface plans esquisses 3D
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySketchPlanes, False)
'Efface Lumieres
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLights, False)
'Efface Grille
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swGridDisplay, False)
'Efface Camera
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCameras, False)
'Efface Calques
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDecals, False)
'Efface plans de coupes interactives
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLiveSections, False)
'Efface points de routage
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints, False)
'Efface nom des cotes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swShowDimensionNames, False)
'Efface symbole centre de masses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCenterOfMassSymbol, False)
'Efface cordons de soudures
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayWeldBead, False)
'Affiche (propriété document)representation filetages
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCosmeticThreads, True)
'Affiche (propriété document)References
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatums, True)
'Efface (propriété document)Cibles deReferences
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatumTargets, False)
'Efface (propriété document) Cotes de fonctions
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayFeatureDimensions, False)
'Efface (propriété document) Cotes de References
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferenceDimensions, False)
'Efface (propriété document) Cotes DimExpert
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDimXpertDimensions, False)
'Affiche (propriété document) Representation filetage Ombré
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayShadedCosmeticThreads, True)
'Affiche (propriété document) Tolerances geometriques
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayGeometricTolerances, True)
'Affiche (propriété document) Notes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayNotes, True)
'Affiche (propriété document) Etats de Surfaces
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySurfaceFinishSymbols, True)
'Efface (propriété document) Cordons de soudures
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayWeldSymbols, False)
'Efface (propriété document) Cube Visualisation
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewDispGlobalBBox, False)
'****************************************************************************************************************
ElseIf Filetype = 3 Then 'Si le document est un document Mise en Plan...
Set Part = swApp.ActiveDoc
'Efface plans
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayPlanes, False)
'Efface axes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAxes, False)
'Efface axes temporaires
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayTemporaryAxes, False)
'Efface points
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints2, False)
'Efface systeme de coordonnées
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCoordSystems, False)
'Efface Origines
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayOrigins, False)
'Efface Systeme de references
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatumCoordSystems, False)
'Efface lignes neutres
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayPartingLines, False)
'Efface courbes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCurves, False)
'Affiche Annotations de premier niveau
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAllAnnotations, True)
'Efface Annotations de composants
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCompAnnotations, False)
'Efface Esquisses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySketches, False)
'Affiche cotations esquisses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swHideShowSketchDimensions, True)
'Affiches contraintes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewSketchRelations, True)
'Efface plans esquisses 3D
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySketchPlanes, False)
'Efface Lumieres
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLights, False)
'Efface Grille
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swGridDisplay, False)
'Efface Camera
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCameras, False)
'Efface Calques
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDecals, False)
'Efface plans de coupes interactives
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLiveSections, False)
'Efface points de routage
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints, False)
'Efface nom des cotes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swShowDimensionNames, False)
'Efface symbole centre de masses
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCenterOfMassSymbol, False)
'Efface cordons de soudures
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayWeldBead, False)
'Affiche (propriété document)representation filetages
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCosmeticThreads, True)
'Efface (propriété document)References
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatums, True)
'Efface (propriété document)Cibles deReferences
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDatumTargets, False)
'Efface (propriété document) Cotes de fonctions
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayFeatureDimensions, True)
'Efface (propriété document) Cotes de References
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferenceDimensions, True)
'Efface (propriété document) Cotes DimExpert
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayDimXpertDimensions, False)
'Affiche (propriété document) Representation filetage Ombré
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayShadedCosmeticThreads, True)
'Affiche (propriété document) Tolerances geometriques
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayGeometricTolerances, True)
'Affiche (propriété document) Notes
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayNotes, True)
'Affiche (propriété document) Etats de Surfaces
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySurfaceFinishSymbols, True)
'Efface (propriété document) Cordons de soudures
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayWeldSymbols, False)
'Efface (propriété document) Cube Visualisation
boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewDispGlobalBBox, False)
End If
End Sub
In this macro, toggle the settings between True and False as per your expectations...
Kind regards.
Normally by saving it keeps the display setting.
And for the other assemblies created from the model, you have to set it up in the same way and save it under ASMDOT
Thank you for your answers, it's okay the display is activated by default on the other hand I don't see the note or comment I created, I thought I would see it on the 3D screen but nothing at all!! Unless there is another method?
Unless I'm mistaken, the annotation views are on one of the planes, so only visible in certain positions
you also have to juggle with the Annotations in the Treemanager:
Either with the visibility of " Unaffected Objects " or by using the planes on which the annotations are created.
It's frankly not very " UserFriendly "...
Maybe there is another mode than these notes that I don't know to show me an alert when opening my assembly??
There are Commentaries, but they are not necessarily very visible either.
(To be associated with "Show comment indicator" in the tree display...)
There is the marking, but it's the same, it's fixed on an orientation.
A bit barbaric solution, create a part in the asm and make an extrusion of a text