Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Error when adding custom SVG symbol to block
Error when adding custom SVG symbol to block [message #1770464] Fri, 11 August 2017 22:33 Go to next message
Brad Crochet is currently offline Brad CrochetFriend
Messages: 32
Registered: July 2017
Member
Oxygen (4.7.0)

I'm following directions here:

https://wiki.eclipse.org/MDT/Papyrus/UserGuide/Symbols

for adding a custom symbol to a SysML block. It works when I use a PNG file, but when I try with an SVG, I get a "Uncaught exception in transaction pre-commit task" Error (full details in the attached text file). I tried with another, even simpler, SVG file, and got the same type of error (though with slightly similar details). I've included the original SVG I'm using as an attachment.

Is there some trick to making the SVG work?

Thanks!
Re: Error when adding custom SVG symbol to block [message #1771137 is a reply to message #1770464] Tue, 22 August 2017 11:37 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

the problem is caused by the SVG file or rather by the absence of proper error messages, if Papyrus can't handle some SVG elements.

(1) The units must be in pixels, not in MM. This is a Papyrus bug: NPE if SVG unit is not in pixels, eventually also a bug in apache.batik - but rather not, since I've already a work-around. See also the following forum thread.

(2) The Eclipse SVG support does not like the "flowRoot" tag in your file. If I remove it (see attached file) and change the units to pixels. the SVG file is shown.
Re: Error when adding custom SVG symbol to block [message #1771145 is a reply to message #1771137] Tue, 22 August 2017 13:03 Go to previous messageGo to next message
Brad Crochet is currently offline Brad CrochetFriend
Messages: 32
Registered: July 2017
Member
Thank you Ansgar! I would not have figured all that out on my own. Your solution(s) are working on my end as well.
Re: Error when adding custom SVG symbol to block [message #1772307 is a reply to message #1770464] Thu, 07 September 2017 19:32 Go to previous messageGo to next message
Brad Crochet is currently offline Brad CrochetFriend
Messages: 32
Registered: July 2017
Member
Okay, I may have jumped the gun a little, as I am now not able to reproduce the success I had with Ansgar's file. To be very clear, the file LinFit.attempt.svg is the file LinFit.svg with the following performed on it within Inkscape:

1) Set Units to Pixels within Inkscape by going to File -> Document Properties -> [Page Tab] -> [Custom size Section] -> Units: px. Expand the "Resize page to content..." option and hit the Resize button.

2) I removed the "rootFlow" tag by selecting everything in the diagram and executing Text -> Convert to Text. I took this instruction from the website:
https://graphicdesign.stackexchange.com/questions/21662/how-does-inkscape-decide-whether-to-use-flowroot-or-text

When I try to use LinFit.attempt.svg within Papyrus (in exactly the same place I am successfully using LinFit.working.svg), I get the two errors shown in the attached "SVG attempt.log".

And so, I'm still botching something up. Help?

Thanks!
Re: Error when adding custom SVG symbol to block [message #1772876 is a reply to message #1772307] Mon, 18 September 2017 08:44 Go to previous message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
I actually removed the flowRoot with a text editor. It is still present in the LinFit.attempted.svg (towards the end)

...
<flowRoot
xml:space="preserve"
id="flowRoot4532"
...</flowRoot>
Previous Topic:[Oxygen] Cannot create a context link
Next Topic:papyrus compiles error ---target
Goto Forum:
  


Current Time: Wed Apr 24 21:15:29 GMT 2024

Powered by FUDForum. Page generated in 0.03422 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top