News:

The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software can be used with TurboCAD.

Main Menu

change Text Style / Documentation

Started by ibruethsch, January 19, 2010, 01:09:38 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

ibruethsch

I want to change the Text Style with vb/vba

Property: StyleId 
With the macrorecorder:

   Start "Insert|Text"
On Error Resume Next
ActiveDrawing.Styles("Normal Text").Activate
if Err.Number <> 0 then
   MsgBox Err.Description,,"Playback error"
End If
On Error GoTo 0

And then want to change the “Text Styles”

(see pic)



that crashes TC16

EventType : BEX     P1 : Tcw16.exe     P2 : 16.2.54.0     P3 : 4ae81f89     
P4 : MacroPlt.dll     P5 : 16.2.54.0     P6 : 4ae81cba     P7 : 0001e5d9     
P8 : c0000409     P9 : 00000000   

Same crash when I want to change the StyleId with vb/vba

Question: how to change the styleId via SDK?

Question2: @ Kevan Chapman: in may 2009 you mention, that you will update the SDK-documentation. I know it will be a lot of work. Do you see already the end of the tunnel?

Best regards
Bernd



[attachment deleted by admin]

nikkipollard

Sorry for replying to an old question. But I have the same question and was wondering if you were ever able to solve it?

It seems that

ActiveDrawing.Styles("Normal Text").Activate will work if the active tool is Text.

Start "Insert|Text" wont work I think this is referring to a macro or something to do with the menu.

sdk shows

Application.Tools("someName").Activate
as the method to activate a tool

The problem is I don't know where to find "somename"
I tried

quering all the
"CommandName"
which gave me a list of commands like this

"Insert|Text"

But I am getting an error message.



Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

nikkipollard

#2
In case someone needs the answer to this.
If I record drawing text with the macro recorder with detect mouse clicks unchecked.
It seems they use the regen method to add the text. There is a parameter for the property preset in that method.
As long as the "style"/Property preset  is defined in the drawing

This works. in the macro recorder



Dim gText
Set gText = tcDraw.Graphics.Add(6,"TCW40TEXT",False,"Normal Text")
  gText.Properties.Item("Info").Value = "My amazingly imaginative text"
  Call gText.MoveAbsolute(1000,200,0,0,0,0)
gText.Update
gText.Draw



I don't know how to create new presets (Styles) with the SDK
But you can edit the "normal" one with the SDK
vb.net code

Dim Styles As IMSIGX.Styles = TcDraw.Styles
Dim Props as IMSIGX.Properties =Styles("Normal Dimensions").Properties
Dim propColor as IMSIGX.Property  = Props("PenColor")
propColor.Value = 255


Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h