Message 1 of 4
Updating text-attributes takes long on server, not on local computer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I made a macro that updates text-attributes on an Inventor-drawing.
Everything works perfectly, but when I run my code on server, this takes way longer (this was a lot faster before).
Any ideas what can be the cause?
I attached 3 video's:
- Keramo_Tekstvelden_lokaal-alle velden.mp4: all text-attributes (#129) are filled in, this takes more or less 3s on a local computer. On a server, this takes almost 2 minutes.
- Keramo_Tekstvelden_server.mp4: only 20 textvalues are filled in, this takes more or less 13s on server
- Keramo_Tekstvelden_lokaal.mp4: only 20 textvalues are filled in, this takes less than 1s on local computer
Sub AlleTekstveldenInvullen()
Call SetAttribute("ATT100", "ATT100")
Call SetAttribute("ATT101", "ATT101")
'and 129 more...
End Sub
Public Sub SetAttribute(AttributeNaam, Waarde)
Dim Drawing As DrawingDocument
Set Drawing = ThisApplication.ActiveDocument
Dim tb As TitleBlock
Set tb = Drawing.ActiveSheet.TitleBlock
'Dim textB As TextBox
'For Each textB In tb.Definition.Sketch.TextBoxes
' MsgBox textB.FormattedText & "-" & tb.GetResultText(textB)
'Next
Dim oPropSets As propertySets
Set oPropSets = ThisApplication.ActiveDocument.propertySets
Dim oBlock As PropertySet
Set oBlock = oPropSets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Dim oBlockProp As Property
For Each oBlockProp In oBlock
Select Case oBlockProp.Name
Case AttributeNaam
oBlockProp.Value = Waarde
End Select
Next
' Drawing.Update
End Sub