SebastienB

Trouble multi-line field in a plugin obect since VW2017

4 posts in this topic

Hello Everybody,

 

I have a problem since installation of VectorWorks 2017.

I created a plugin object with text parameters.

 

When I typed, for example, "Line 1\r Line 2" in a text field in Object Info, the result was:

Line 1

Line 2

It was perfect.

 

Since I have installed the release 2017, the result is:

Line 1\r Line 2

--> the \r don't works anymore

How can I do?

 

Thanks

0

Share this post


Link to post
Share on other sites

Posted (edited)

Hi Sebastien,

 

I guess  VW 17 does not respect  escape sequences because it can have bad side effects.

If you provide a win path for example

 

folder\ronald  >>

 

folder

onald

 

You can print the raw string with the command:

s = StringFromTheField
print (repr (s))

If the result contains  '\\r' instead of '\r' the escape sequence was disabled.

Just replace it with '\r' to make it work again.

s = 'A\\rB'
s = s.replace ('\\r', '\r')

regards

 

 

Edited by Patrick Winkler
0

Share this post


Link to post
Share on other sites

Yess, it was that, my problem is solved, thanks :)

0

Share this post


Link to post
Share on other sites

Prior, Vectorworks wasn't sending escaped strings to the scripting engine.  While this was nice for line breaks, having a text field with, say, an apostrophe could break a script.

 

-Josh

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now