API Error inserting sketched symbol on inactive sheet?

API Error inserting sketched symbol on inactive sheet?

Ralf_Krieg
Advisor Advisor
407 Views
1 Reply
Message 1 of 2

API Error inserting sketched symbol on inactive sheet?

Ralf_Krieg
Advisor
Advisor

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
0 Likes
408 Views
1 Reply
Reply (1)
Message 2 of 2

Ralf_Krieg
Advisor
Advisor

Has no one any idea to this question? Is the error reproduceable by others?


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes