How to set the height of sketch image or set the visibility?

How to set the height of sketch image or set the visibility?

hamzabuttX6GV8
Contributor Contributor
242 Views
1 Reply
Message 1 of 2

How to set the height of sketch image or set the visibility?

hamzabuttX6GV8
Contributor
Contributor

Hi,

 

I used attribute helper to define the sketch image inside the sketch symbol.

There are some writable properties for sketchimage in iLogic but I can't seem to find the exact syntax required to change these properties (height, width, visibility etc.) and errors are returned due to this.

Following is code:

Dim oImage1i As SketchImage
oObjs1i = oDrawDoc.AttributeManager.FindObjects("BACKPLATE_STIFFENING_STRIPS_i", "BACKPLATE_STIFFENING_STRIPS_i", "1")
oImage1i = oObjs1i.Item(1)

oImage1i.Visible = False
oImage1i.Height = 10

End If

 

Following are the errors:

 

hamzabuttX6GV8_0-1653978079063.png

 

 

0 Likes
243 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @hamzabuttX6GV8.  You said that this sketch image is within a sketched symbol, right?  This may be part of why it will not let you simply change its size directly.  Editing a sketched symbol is sort of like editing a title block on a drawing sheet.  A sketched symbol object (Link1) placed on a drawing sheet is just a driven instance of the single sketched symbol definition object (Link2) stored at document level.  The sketch behind that sketched symbol must be edited through the sketched symbol definition object (Link3), and that definition object must be put into 'Edit Mode' (Link4) before your changes will be allowed, and before they can be saved.  Once you have the SketchedSymbolDefinition in edit mode, you are given Read/Write access to a copy of the sketch within it.  At this point you should be able to make those changes.  Then you would use the ExitEdit method of the SketchedSymbolDefinition to save the edited sketch back over the original sketch.

As for how to get the SketchedSymbolDefinition from the found SketchImage object...that's another complication.  The SketchImage object has a Property named Parent, which returns a generic Object.  But that object is supposed to be the sketch that the SketchImage is within.  In this case, that sketch object should be a DrawingSketch.  I'm not sure if you could get the SketchedSymbolDefinition object from that DrawingSketch.Parent property or not, but you could try it.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes