Ilogic to place a sketch symbol with field text in it

Ilogic to place a sketch symbol with field text in it

akaluri
Enthusiast Enthusiast
711 Views
3 Replies
Message 1 of 4

Ilogic to place a sketch symbol with field text in it

akaluri
Enthusiast
Enthusiast

Hello ,

 

I am currently using the following code to place sketch symbol in my drawing. But this doesn't seem to be working for sketch symbol with field text in it (or prompted entry). Do you know how to place such a sketch symbol using ilogic? Thanks in advance!

    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument


    'create insertion point
    Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
    Dim oInsertionPoint As Point2d
    
    'define the insert point for the symbol
    oInsertionPoint = oTG.CreatePoint2d(5,5) 
'define symbol Definition to use oSymDef= oDrawDoc.SketchedSymbolDefinitions.Item("MYSKETCHSYMBOL") 'Get the current active sheet Dim oCurrentNumber As Sheet oCurrentNumber = oDrawDoc.ActiveSheet 'insert the new symbol oSym = oCurrentNumber.SketchedSymbols.Add(oSymDef,oInsertionPoint,0,1,Nothing)

 

 

0 Likes
Accepted solutions (1)
712 Views
3 Replies
Replies (3)
Message 2 of 4

akaluri
Enthusiast
Enthusiast
Accepted solution

I am able to place the symbol when I insert the following string into the code.

The sketch symbol has 7 field that can be filled. But when I run, the sketch symbol is being placed but not the string values.

 

    Dim sPromptStrings(6) As String       
    sPromptStrings(0) = "123"
    sPromptStrings(1) = "123"
    sPromptStrings(2) = "123"
    sPromptStrings(3) = "123"
    sPromptStrings(4) = "123"
    sPromptStrings(5) = "123"
    sPromptStrings(6) = "123"

    
    'insert the new symbol
    oSym = oCurrentNumber.SketchedSymbols.Add(oSymDef,oInsertionPoint,0,1,sPromptStrings)

 

0 Likes
Message 3 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@akaluri ,

 

Can you please provide non confidential drawing with sketched symbol to investigate?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 4 of 4

akaluri
Enthusiast
Enthusiast

@chandra.shekar.g the program seems to be working with the solution I provided. Thanks.

0 Likes