Book a Demo

Author Topic: Newlines in Connector Labels  (Read 4393 times)

THADC

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Newlines in Connector Labels
« on: March 11, 2014, 01:39:19 am »
Hello, is there a way to place newlines inn connector labels? Using the size adjusters right on the diagram is ok, but it does not allow me to align line-by-line in the label exactly as I would like.

Grateful for any response. Thank you.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Newlines in Connector Labels
« Reply #1 on: March 11, 2014, 02:04:27 am »
I guess you can't. EA even filters newline chars when trying to paste them into the connector name. Maybe a script can bypass the filtering?

q.

P.S. Yes. A script lets you place newline chars and the text is wrapped at that place. Why does the API prevent that???
« Last Edit: March 11, 2014, 02:07:09 am by qwerty »

THADC

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Newlines in Connector Labels
« Reply #2 on: March 11, 2014, 02:46:14 am »
Thank you. That was helpful. I am too much of a newbie right now to create scripts, but could see myself getting into that down the road.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Newlines in Connector Labels
« Reply #3 on: March 11, 2014, 03:34:21 am »
I used a Perl script:
Code: [Select]
my $rep = $ENV{'REP'};
my $e = $rep->GetTreeSelectedObject();
my $con  = $e->Connectors->GetAt(0);
$con->{Name} = "new\nname";
$con->Update();
just to test it. For a regular use some nice add-in with a dialogue is to be preferred. For the first steps I (of course) can recommend my Scripting book. If you want to see some advanced stuff (C-something) check out Geerts add-in framework.

q.