Noob question #004? immutable objects

What method/property determines if the doc object of an instance of a class from the Rhino.Geometry namespace can be modified, or not? By modified I mean the object in 3d to be moved, rotated or scaled

Please use descriptive topic titles.

4 Likes

:smiley:

I totally agree with this, and almost all of my questions are doing this.
I needed a way to track these programming noob questions. Also when the question is short I can fit it all in the title which is stupid as well. I also don’t like when the complete description is in the title. The title should be short, always.

You can search your own posts. If you include noob in your topic text, it should show up in the search, and you can choose to sort these by latest topic.

I started a series of noob questions.

Anyways, how is this discussion contributing to the forums, and to the question I asked. You’re Regular if you dont like my title - change it.

it is not other users job to determine your own topics and to change it for you. on the other hand having a more elaborate designation would help yourself in backtracking but also in getting help from others and most of all would help others having the same question.

I agree, but cluttering my thread with off-topic discussion helps even less. I put a title as I feel fit. If one doesn’t like it and one have permission, one should change it.

Forums’ search engine doesn’t just look in the title. If someone is searching he will find the topic however it is titled.

The question I ask is generic, no particular case at hand as such I cannot define a proper title besides that it’s a noob question. Which it is. Hell, I don’t even know the difference between class *EventArgs, Event, EventHandler, Delegate, etc. How can I formulate the name properly?!

By the way, I might have found what I was looking for:
https://developer.rhino3d.com/api/RhinoCommon/html/E_Rhino_RhinoDoc_BeforeTransformObjects.htm
https://developer.rhino3d.com/api/RhinoCommon/html/Properties_T_Rhino_DocObjects_RhinoTransformObjectsEventArgs.htm

I need to figure out a way to prevent transformation of objects. I guess I have to use events. I want the object to be selectable but not modifiable.

This:

Seemed pretty helpful to:

I suspect you’d make a big song and dance about that too (and indeed, also not our job).

It’s noone’s job to answer questions nor make pointless remarks that do not contribute to the topic at hand.

Was it worth it to ruin my question with all that jibber jabber?
I’m not new to this forums I know how to ask questions.

I’m pretty sure you’ve understood my question perfectly, you’re python guru. Why the deflect. If you don’t want to answer, don’t. If you want to point out that I’m a noob programmer, thanks I know that. In fact I always refuse to call myself a programmer. I’m a script kiddie, I always say this. What was the point in all this?

Moderators, by all means lock this thread. There’s too much bullshit in it already.

is absolutely unnecessary.

Dude, I’ve literally tried to offer you genuine tips on how you might track your Noob #000 questions (without cluttering/spamming the rest of the forum with endless meaninglessly named topics that serve as your personal notebook). Did you even try the search functionality?

And yet you insist on not following the guidelines provided by McNeel (i.e. name your topics, provide files etc).

Indeed, I’ll be sure not clutter your precious topics anymore.

Anders,

“Clutter” them with useful comments not with crap you put on this thread.
Have the respect I give you.

From the very first comment on this thread, everything was off-topic. What is the matter with you today?!

Btw your comments are also violation of these guidelines, since everything is off-topic and disrespectful.

2 Likes

whatever guys go and drink a beer.

2 Likes

If i understand correctly, as long as an object is document controlled, and in normal state, there is nothing to prevent it from beeing transformed by the user. Maybe you can try to explain what you’re after if my answer is off-topic.

_
c.

Thanks for replying @clement

Right on-topic.

This is what I am after:

I assume I need to use this event.
https://developer.rhino3d.com/api/RhinoCommon/html/E_Rhino_RhinoDoc_BeforeTransformObjects.htm

and this EventArgs:

https://developer.rhino3d.com/api/RhinoCommon/html/Properties_T_Rhino_DocObjects_RhinoTransformObjectsEventArgs.htm

in order to identify the objects I want to make immutable.
Perhaps in addition I need to store the guid of these objects either in sticky or in document’s usertext to compare them when the event triggers…

Hi @ivelin.peychev, yes this is the one. I used this in the past to prevent that a user moves a point over another point to prevent a duplicate. The tricky part is that you need to keep track of e.ObjectsWillBeCopied because the user may just transform the existing object (which you can then find by id and move back using the inverse transform) or he creates a new transformed object. (if Copy=Yes)

As a general advice for all the events, exit them as early as possible. They will be fired for every transform made which in case of thousands of objects can lead to performance issues.

_
c.

1 Like

I am still learning how to handle events, what do you mean by “exit them as early as possible”?

Say you have stored the object (id) which is not allowed to be transformed, make the id comparison in the first line of the event. If nothing in e.Objects matches your id, return from the event immediately.

_
c.