Anthrazit

770 Reputation

11 Badges

5 years, 2 days

MaplePrimes Activity


These are questions asked by Anthrazit

Apparently it isn't possible to access components in a workbook from procedures from a library.

Just wanted to know if that is correct, or if I am missing something here.

E.g. this procedures should delete contents of TextAreas with endings defined in a list of variables. Works nicely in the workbook, but when putting the procedure in a library, it apparently doesn't work anymore.
 

ResetCombobox := proc (var::set) local i; for i in var do if ComponentExists(cat("TextArea_", i)) then SetProperty(cat("TextArea_", i), value, 0) elif ComponentExists(cat("ComboBox_", i)) then  else Advarsel(cat("No component found for ", i)) end if end do end proc


 

Download ResetCombobox.mw

Apparently a colon within a string causes some issues when generating a XMLElement.

Didn't find anything in Maple Help about that though.

with(XMLTools)

dummy := "NS-EN 1995-1-1, part 1-1, Section 6"

"NS-EN 1995-1-1, part 1-1, Section 6"

(1)

XMLElement(dummy)

_XML_Element(_XML_ElementType("NS-EN 1995-1-1, part 1-1, Section 6"), [], [])

(2)

dummy1 := "NS-EN 1995-1-1, part 1-1, Section 6: Ultimate"

"NS-EN 1995-1-1, part 1-1, Section 6: Ultimate"

(3)

XMLElement(dummy1)

Error, (in XMLTools:-XMLElement) element tag name `NS-EN 1995-1-1, part 1-1, Section 6: Ultimate' contains the namespace prefix `NS-EN 1995-1-1, part 1-1, Section 6', but there is no `xmlns' attribute

 

NULL

Download xmlns.mw

Is there any way to convert a variable name to a string?

In that example, the content of the variable is converted to string, not the name of the variable.


 

a := 2

2

(1)

convert(a, string)

"2"

(2)

NULL


 

Download convertstring.mw

Is there any equivalent to Excel function arctan2?

This function takes x and y values, and returns values from -Pi to +Pi. In that way one can easily get the x and y values of an angle with correct signs.

Are there any examples showing how to plot multiple items in one plot?

  • What I have started with is to put a Plot component in my sheet, so that I can use that by its name.
  • Next thing on the list was to generate different plot objects, by assigning each of them to a variable.
  • To plot the whole bunch, I collected all the items I want to plot in a list
  • And plotted them by SetProperty("MyPlotcomponent", value, display(plotlist))

I wonder if this is the best way to do it. Especially when adding more stuff afterwards, would it be possible to just add something to the plot component?

Do I need plot components at all?

First 9 10 11 12 13 14 15 Last Page 11 of 25