I would like to recommend some improvements concerning annotation tools.
Any annotation containing text should show the same properties to format the text. For example, it is actually not possible to set the character format like bold, italic, etc. on the text associated with leader…
I would like to see any text object with an adjustable bounding box which we could use to set where the text is wrapping. AutoCAD is doing this the right way I think.
I would like to be able to format the text over each word and not for the whole text object.
Concerning “Fx” (text formula), why not be able to script them? The currently proposed formula are limited.
Obviously, a scripted text formula need to return a “string”, so I see it this way.
Maybe somewhere in the options of the 3dm file we could create a list of named variables. Each named variables would be categorized as “String”, “Number”, etc. Then each named variables could be linked to a script (like rhinoscript) or an exposed function of a plugin which return the proper type.
Finally, inside the text properties we could add any named variables like %myvariable%…
Are you saying you want to put a script inside a text formula or that you want more access to text formulas in things like RhinoScript, python, RhinoCommon?
Inside a RhinoCommon plugin I could have this exposed function :
public string LeftActiveViewName(int length)
{
string result = "";
if (length > 0)
{
RhinoDoc doc = Rhino.RhinoDoc.ActiveDoc;
string view_name = doc.Views.ActiveView.ActiveViewport.Name;
result = (view_name.Length < length) ? view_name.Substring(0, length) : view_name;
}
return result;
}
Inside the text properties I would type inside : The page layout number is : %LeftActiveViewName(3)%
The text object should then show this if the page layout name is “001 Layout” : The page layout number is : 001
My example directly “link” a text formula to a function, but I guess it needs an interface between them which I describe in the previous post as a list of “named variables”. So to answer your question, my request is to be able to create custom text formula using any of the supported laguage like RhinoScript, RhinoCommon, etc. Maybe the ability to put a script inside the text object properties would be also interesting, but I think it would be more useful to associate script inside a list of “named variables”, that way we could use it in many text objects…
Yes, that is more clear; thanks. I looked into adding support for this in V5 and decided not to expose the functionality until we knew that we could limit the scope of what the string evaluation routines could do since the scripts would be run without the user’s knowledge when the textfield is being displayed.
By limiting, we want to make sure you can’t write some script that performs malicious actions (deleting of files would be one such action).
That’s a good point about the malicious scripts. So probably the interface between code and custom text formula (which I previously named “named variables list”), could be used to test the conformity of the code.
Probably any custom text formula needs to be derived from a specific class (let’s say TextFormulaClass) that only allows the execution of some predetermined code. So in that scope, you could simply exposed what is permitted).Maybe something like Google done for their Google App Script.
Is it possible to do some arithmetic operation with the text formula. I did try this to convert the area value from square inches to square feets, but it doesn’t seem to work. In fact it does not see the “/144” at all.
%<area("id")/144>%
Also, I tried this to do the total of 2 areas, but doesn’t work again
%<(area("id1")+area("id2"))/144>%
A some functions to round result (round, floor and ceiling) would be also appreciated,