API Error inserting sketched symbol on inactive sheet?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
To reproduce the error create an IDW with 2 or more sheets and a sketched symbol "Test". Then try the following code. The skteched symbol on sheet 2, 3 and so will be displayed on sheet 1. Then save the file, close it and try to open. You'll get an segment fault error and the file will not open.
Is this an error or is it still not possible to insert sketched symbols on inactive sheets or am I doing it the wrong way?
Private Sub InsertSketchedSymbol()
Dim oDraw As DrawingDocument
Set oDraw = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oSketchedSymbol As SketchedSymbol
Dim oPosition As Point2d
Set oPosition=ThisApplication.TransientGeometry.CreatePoint2d(32.5,6.5)
For Each oSheet In oDraw.Sheets
Call PutNewSymbol(oPosition, oDraw, oSheet)
Next
End Sub
Private Function PutNewSymbol(ByVal oPosition As Point2d, ByVal oDraw As DrawingDocument, ByVal oSheet As Sheet)
Dim oSymbol As SketchedSymbolDefinition
Set oSymbol = oDraw.SketchedSymbolDefinitions.Item("Test")
Call oSheet.SketchedSymbols.Add(oSymbol, oPosition)
End Function
R. Krieg
RKW Solutions
www.rkw-solutions.com