Nevron Forum

NMaster Text XML Format

https://www.nevron.com/Forum/Topic5376.aspx

By Volvick Derose 1 - Thursday, July 14, 2011

I wonder if the NMaster string can accept xml format for instance

string xmlStringOne;
String xmlStringTwo

NMaster shapeMaster = new NMaster(shape, NGraphicsUnit.Pixel, xmlStringOne, xmlStringTwo);

please let know if that is possible

For instance, I can have xml format for a shape where I can display subscripts, I want to know if that is possible for xmlStringOne and xmlStringTwo in the master
By Nevron Support - Friday, July 15, 2011

Hi Volvick,

You can show subscripts and superscripts in a NMaster description by using the appropriate Unicode characters. The following is a simple example: 

 

======================================================================

// Create a library document

NLibraryDocument libDoc = new NLibraryDocument();

 

// Create a master and use a superscript 2 in its description

NMaster a = new NMaster(new NRectangleShape(0, 0, 2, 2), NMeterMetricUnit.Meter, "Square", "Square with area of 4 m\u00B2");

libDoc.AddChild(a);

 

// Create a library view

NLibraryView libView = new NLibraryView();

libView.Document = libDoc;

libView.Dock = DockStyle.Fill;

 

// Create a simple form to host the library view

Form form = new Form();

form.Controls.Add(libView);

form.Text = "Library";

form.FormBorderStyle = FormBorderStyle.FixedToolWindow;

form.TopMost = true;

 

// Show the form

form.Show(); 

======================================================================

 

This code will produce the following form:

 

By Volvick Derose 1 - Friday, July 15, 2011

Thank you very much, I will implement that
By Volvick Derose 1 - Sunday, July 17, 2011

I am not too familiar with those escape characters. What I need to do, I need to put something like P subscript N, but right now I am using something like P[N]; which I don't like. I tried the chart in Wikipedia, but it looks like those characters are preset. There must be a way to do that
By Nevron Support - Monday, July 18, 2011

Hi Volvick,

 

Check out this Wikipedia article: Unicode subscripts and superscripts

By Volvick Derose 1 - Tuesday, July 19, 2011

I did not look at the pdf document. I should have scrolled down a little bit more

I tried, it did not appear big enough; looks like I have to use bracket instead