Ballon Text Alignment

Experimenter
Experimenter

In draft view,how do I align center or right for text of Balloon with no lead (callout property = 1) by VB ? For TextBox, I can do it by HorizontalAlignment property = 1 (center) or = 2 (right). 

 

Thanks for any help.

 

- Sho

 

8 REPLIES

Re: Ballon Text Alignment

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I don't personally see a way to do what you're asking. I always try to answer these types of questions with the Solid Edge GUI first. I cannot find a way through the GUI to do what you're wanting and that usually means there's no API way to do it either. Generally speaking, GUI functionality comes first, then API functionality. That's why I start with the GUI first.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Ballon Text Alignment

Experimenter
Experimenter

Dear Jason

 

Thank you for reply and sorry for my poor explanation.

I want to add Ballon with no lead by VB.

In draft view,

 

 Dim app as Object, act as Object, acs as Object, ret as Object

 Set app = GetObject(, "solidedge.application")

 Set act = app.ActiveDocument

 Set acs = act.ActiveSheet

 Set ret = acs.Balloons.Add(0.1, 0.1, 0)          <- add Ballon at x=100mm, y=100mm
 ret.Callout = 1                                             <- Set Ballon with no lead

 ret.BalloonText = "TEXT"                              <- Set Balloon text "TEXT"

 Call ret.BalloonHorizontalAlignment(1)           <- Problem!

 

After setting text by VB, I can align text at center by GUI (show picture).

 

I use ST4 and VB6.

 

- Sho

 

Re: Ballon Text Alignment

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

That helped. You're looking for the CalloutHorizontalAlignment property.

 

balloon.CalloutHorizontalAlignment = SolidEdgeFrameworkSupport.TextJustificationConstants.igTextJustifyLeft
balloon.CalloutHorizontalAlignment = SolidEdgeFrameworkSupport.TextJustificationConstants.igTextJustifyVCenter
balloon.CalloutHorizontalAlignment = SolidEdgeFrameworkSupport.TextJustificationConstants.igTextJustifyRight

 

Good luck!

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Ballon Text Alignment

Experimenter
Experimenter

Thank you for your fast replay. But, error occur.

 

 ..........

 ret.Callout = 1

 ret.BalloonText = "TEXT"

 ret.CalloutHorizontalAlignment = SolidEdgeFrameworkSupport.TextJustificationConstants.igTextJustifyRight     <- Error

 

Error 438 : object doesn't support this property or method

 

Checking by Solid Edge Spy, CalloutHorizontalAlignment property isn't found.

By ST4 SDK help, BalloonHorizontalAlignment Method is

 Public Sub BalloonHorizontalAlignment( ByVal Alignment As TextHorizontalAlignmentConstants )

 

So, I try

 

 Call ret.BalloonHorizontalAlignment ( SolidEdgeFrameworkSupport.TextJustificationConstants.igTextJustifyRight )

 

But, result is same error.

What is problem ?

 

- Sho

 

Re: Ballon Text Alignment

Experimenter
Experimenter

Sorry. I said mistake.

 

 Call ret.BalloonHorizontalAlignment ( SolidEdgeFrameworkSupport.TextJustificationConstants.igTextJustifyRight )

 

No error happen. But, anything no change.

 

 

Re: Ballon Text Alignment

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

CalloutHorizontalAlignment was added to the API in Solid Edge ST5. What version of Solid Edge are you using for development? They added a TON of Draft APIs in ST5.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Ballon Text Alignment

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

FYI, I knew what version of Solid Edge that property was added by searching the online Solid Edge ST6 SDK. There is a What's New section for each release of Solid Edge. I actually used the search functionality of the site to quickly find the page by searching for CalloutHorizontalAlignment.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Ballon Text Alignment

Experimenter
Experimenter

Dear Jason

 

Thank you for advice. Now ST4. Then, I'll try after upgrade ST5.

 

- Sho