Set Origin to Geometry moves objekt - blender

I wanted to set the origin in the middle of the objekt so i used the function "set origin to geometry" I thought this function moved the Origin not the Objekt
Before Set Origin to Geometry
After Set Origin to Geometry

You are correct that the 'Set Origin to Geometry' function will move the origin point to the 'center' of the object.
Judging by your model, I would guess this would put the origin in the center of the ring.
Using 'Set Origin to Geometry' should not move your object - are you certain that you did not select 'Object to Cursor' or something similar?
Also - are you certain that the 'SimpleDeform' modifier that you have applied to the object is not causing the problem? Try selecting the little monitor icon on the modifier to disable it in the viewport.
You could also try this is an alternative to set the origin to the center of the object:
Select your object (Left click)
Enter Edit mode (Tab key)
Select all vertices (A key)
Press Shift-S, select 'Cursor to selected'
Enter Object mode (Tab key)
Right-click, select 'Set origin > Origin to cursor'

Related

How to set the origin of a cube to its apex in blender?

For a cube with location (0, 0, 0) I wont it's apex to be at the origin of the coordinate system.
(apex = left bottom front point of the cube)
I tried Tools > Edit > Set Origin.
But it's not possible to achieve what I described.
So how to do this?
If it is blender 2.8+, then:
Press TAB, then select vertex you want to be an origin point.
SHIFT + S, then Cursor to Selected.
Again TAB, Right mouse click, then Origin to 3D Cursor
If not:
Press TAB, then select vertex you want to be an origin point.
SHIFT + S, then Cursor to Selected.
Again TAB, then SHIFT+CTRL+ALT+C, then Origin to 3D Cursor

How would one go about resizing controls in relation to the window that contains them?

How would one go about resizing controls in relation to the window that contains them? I'd like to do this in order to to have the control take up a particular amount of the screen, regardless of whether the window is maximised, and independent of monitor resolution.
I have tried setting control.Width as equal to a multiple of Me.ParentForm.Width and done the same for height. I'm unsure of how to properly access the properties of the form/window in order to resize controls in relation to it. I also tried to alter the .Left property in the same way to set the relative position of the control.
Display.Width = Me.ParentForm.Width * 0.25
Display.Top = 0
Display.Left = Me.ParentForm.Width - Me.Width
The code was intended to make the control take up the entire top-right quadrant of the window, whether it was maximised or not. However, I instead got an exception saying that Me.ParentForm.Width had no value.
This is the exception message:
"System.NullReferenceException: 'Object reference not set to an
instance of an object.'
System.Windows.Forms.ContainerControl.ParentForm.get returned
Nothing."

Rectangular selection of shape in visio using vba

Is it possible to select shapes in Visio by specifying the coordinates of a selection rectangle? If so, how does one do this?
I need to select and delete any shape in a specific location on a Visio page.
I would like to be able to specify the coordinates of a lower left corner and an upper right corner on the page and have vba tell me the id's or handles or something that would allow me to delete these shapes as I need to place a new shape in that particular location. I am looking for something like
shapes = MyVisioPage.SelectByRectangularCrossingBox(lowerleftX,lowerleftY,upperrightX,upperrightY)
You could actually draw a rectangle with those coordinates and then use Shape.SpatialNeighbors to find out all shapes in that rectangle.. Something like this (VBA):
Function SelectByRectangularCrossingBox(page, _
lowerleftX, lowerleftY, upperrightX, upperrightY) As Selection
scopeId = page.Application.BeginUndoScope("try")
Set rc = page.DrawRectangle(lowerleftX, lowerleftY, upperrightX, upperrightY)
Set SelectByRectangularCrossingBox = rc.SpatialNeighbors(visSpatialContain, 0.01, 0)
page.Application.EndUndoScope scopId, False
End Function
The code is wrapped around with BeginUndoScope/EndUndoScope to cancel changes.

Change location of buttons at execution VB.NET

I am trying to change the location and size of buttons I have contained in a panel on a WinForm (vb.NET).
Initially the buttons have a location and an image (no text), but in execution I want to set a new location and text.
I am able to set the text for each button, and as they are set to Autosize, they increase in width.
But despite I set the location by code correctly, when the buttons are displayed they "come back" to their initial position.
Any help would be appreciated.
Thanks,
IM
The following code will change the location to the co-ordinates you specify:
Button1.Location = New Point(x, y)
You must change the x,y values to the co-ordinates on the form that you want to move the button too.
The next bit of code with change the size of your button:
Button1.Height = 10
Button1.Width = 50

Why can't I set DataLabel.Position to xlLabelPositionCustom?

I am working with vb.net and excel 2007 to create some graphs for myself. I wanted to set the datalabel positions to a custom value since the default above position (xlLabelPositionAbove) causes the labels to clash with error bars and the default option for a side (such as xlLabelPositionRight) may leave the label over another point or other errorbar. Due to this, I wanted to set the label to a custom position where it is off to about a 45 degree angle to the top right (like right in the middle of where the default above and right positions would place it).
I tried doing this by adjusting xlMySeries.Points(index).DataLabel.Top and xlMySeries.Points(index).DataLabel.Left at first, however I ran into an undescriptive error leading me to believe I was not doing things correctly. I then thought to try setting xlMySeries.DataLabels.Position = xlLabelPositionCustom and then adjusting top and left. However, to my surprise, I could not even change xlMySeries.DataLabels.Position to xlLabelPositionCustom!
Whenever I try to adjust top, left, or the position to certain datalabel positions, I get HRESULT: 0x80004005 (E_FAIL), which I have generally found to mean "You are doing it wrong" in my experience so far with excel. I cannot set the position member to custom, or anything other than just above, left, right, center (so not bestfit, custom, or any inside___ one)
Any idea why I cannot set the position property to what I need it or otherwise change the position of my datalabels? I just need SOME way to adjust the positioning of my datalabels to a custom psoition (or position other than above, left, right, center, bottum). Thanks in advance!
You can set positions only to whose which you can see on the Data Label properties window.