Communauté
AutoCAD – tous produits - Français
Bienvenue sur les forums AutoCAD d’Autodesk. Partagez vos connaissances, posez des questions, et explorez les sujets AutoCAD populaires.
annuler
Affichage des résultats de 
Afficher  uniquement  | Rechercher plutôt 
Vouliez-vous dire : 

OLE2FRAME

0 RÉPONSES 0
Répondre
Message 1 sur 1
dolives
96 Visites, 0 Réponses

OLE2FRAME

Bonsoir à tous,
Le petit bout de code suivant permet de compter les liens OLE.
Ceux-ci peuvent être des images ou autre. Il y a t'il des moyens d'accéder aux autres informations disponibles pour ce type d'objet ?
Je cherche en vain des exemples sur ce sujet !

....
' OLE2FRAME
Set oDics = ThisDrawing.Dictionaries
For Each oD In oDics
If TypeOf oD Is AcadDictionary Then
If oD.Name = "ACAD_IMAGE_DICT" Then
Set oDic = oD
Set ss = sset(0, "OLE2FRAME")
For Each OleDef In ThisDrawing.SelectionSets
OleNbre = ss.Count
MsgBox "Il y a " & OleNbre & " image(s) ole dans ce dessin"
Next OleDef
End If
End If
Next oD
.....

Public Function sset(FilterType, FilterData As Variant, Optional ssName As String = "SS") As AcadSelectionSet

Dim oSSets As AcadSelectionSets
Set oSSets = ThisDrawing.SelectionSets
For Each sset In oSSets
If sset.Name = ssName Then
sset.Delete
Exit For
End If
Next
Dim FType() As Integer
Dim FData() As Variant
Dim i As Integer
If IsArray(FilterType) = False Then
If IsArray(FilterData) = False Then
ReDim FType(0)
ReDim FData(0)
FType(0) = FilterType
FData(0) = FilterData
Else
Exit Function
End If
Else
If UBound(FilterType) UBound(FilterData) Then
Exit Function 'They must be pairs
End If

ReDim FType(UBound(FilterType))
ReDim FData(UBound(FilterType))
For i = 0 To UBound(FilterType)
FType(i) = FilterType(i)
FData(i) = FilterData(i)
Next
End If

Set sset = ThisDrawing.SelectionSets.Add(ssName)
sset.Select 5, FilterType:=FType, FilterData:=FData
'To use this function for single filter
'Set SS = SSet(0, "insert")
'For multiple filter
'Set SS = SSet(array(0,2),array("insert",oBlock.name)) 'must be pairs
End Function
0 RÉPONSES 0

Vous n'avez pas trouvé ce que vous recherchiez ? Posez une question à la communauté ou partagez vos connaissances.

Publier dans les forums  

Autodesk Design & Make Report