Writing an alias to turn OpenGL on/off and to change text properties


#1

Hello everyone,

I’m using Rhino v5 and I’m searching how to create an alias or a button that turns OpenGL on and off because I need OpenGL to be on when I’m using Pointools4Rhino, and I need it to be off when I use some command like Block, Insert, or Named view.
I can set OpenGL on and off through the option menu but if I have to do this several times, it’s not handy. I tried to type “Options View” but it doesn’t show the OpenGL options.
So someone must know a way to quickly switch OpenGL on/off.

Another request has the same spirit but it’s about text properties. Like the size, if it’s left/right/top/bottom-centered, etc
Is it possible to change these parameters by a command or it’s only in the properties/text panel?

Thanks


#2

The text justification can be changed via Rhinoscript (which could be made into a toolbar button or alias), however I don’t see a way to change the OpenGL setting. Why do you need to do this when inserting or recalling named views?
–Mitch


(Willem Derks) #3

Hi Clement,

Indeed there does not seem a way to access the OpenGl settings through the commandline
@pascal There are many more omissions and unhooked items within the commandline version of Options.( at least these: Toolbars,UpdatesAndStatistics,Licenses)

As for the text alignment; run the hyphened version of the Properties command:
-Properties and follow the commandline options Text - > Justification

However @Pascal It appears that setting the justification for text through the commandline
does not work as it should. Try setting it for instance at MiddelCenter. Nothing happens.

Sorry Clement I wanted to answer you questions and ran into the limitations and bugs…

-Willem


#4

Thanks Willem, didn’t realize that…

Here it works once, the first time you try it. It looks like you have to go back up a level in the command line by hitting Enter and then click back into justification to get it to work again while still in the command.
–Mitch


#5

Thanks for all the answers.

I need to turn OpenGL off because Rhino crashes if it’s activated. They said it was due to my graphic card driver, but I never solved the problem.

Anyway, I also tried the -Properties command and sometimes it works, only sometimes sadly (even the first time). That’s quite weird, why would this command work less than the button in the properties panel?

Helvetosaur, you talked about Rhinoscript to set the text justification, you have more details?


#6

Well, there is a Rhinoscript method available to get/set the text justification. A script could be made that does this. Note: what’s difficult about this is that the text insertion point does not change. So, when you change the justification, the text will move - sometimes significantly. If the text is justified “bottom left” (default) and you change it to “top right”, the text moves in the opposite direction; that is to say it will move to the left and down.
–Mitch


#7

Yeah, I know that, it’s ok.

To explain a bit my goal, I have to draw 2D plans in Rhino and then export it to AutoCAD. I have to create labels to put names or explanations, the command : Leader is great to quickly draw a line with an arrow and a text but, in AutoCAD, the line is broken near the text to fit onto the X axis of the world coordinates system. and that’s quite odd. Maybe there’s a way to fix this?

This would be better than I’m doing now. I’m doing this with a polyline and a text… and as the label can be oriented in several directions, the justifications are important.


(Brian Gillespie) #8

@lowell, can you please have a look at this? There are several ideas of improvements to annotation in this thread.


#9

OK, you can try this script, I don’t know what it’s worth… To use it, place the script somewhere on your hard drive (like your Rhino “scripts” folder), then drag it from there into a running instance of Rhino. This will add an alias “RejustifyText”. When you run the command, you will be asked to select some text objects (preselection OK) and then you will get a list box with the possible justifications. Choose one and hit OK.
–Mitch

RejustifyText.rvb


#10

Thanks a lot, that works great. But as you said I don’t know if it’s that much faster than using the properties panel. It may be more user friendly and faster, combined with a little toolbar with one little button pointing to each direction.

I don’t know if it’s possible to bring each possible justification the script offers to an alias? I know how to create the toolbar from one command/alias but I don’t know how I could do that from your script.I hope I don’t bother you with my requests.

And again thanks for your answers


(Pascal Golay) #11

Yep- I do not get nothing happening here, I just get something other than the justification option I ask for. Checking on it, thanks…

-Pascal