defining bounding box anchor location

defining bounding box anchor location

wproctorPG49C
Enthusiast Enthusiast
1,580 Views
8 Replies
Message 1 of 9

defining bounding box anchor location

wproctorPG49C
Enthusiast
Enthusiast

[ FlexSim 16.0.1 ]

I understand that there is a specific location within a 3D object's bounding box that become the anchor location (for determining the object's location). I believe that is it the lower left corner by default. Is there a way to change the anchor location (like put it in the upper middle location of the box)?

Accepted solutions (1)
1,581 Views
8 Replies
Replies (8)
Message 2 of 9

philboboADSK
Autodesk
Autodesk
Accepted solution

An object's location is stored in the tree by the corner of their unrotated bounding box shown here:

98-direct-spatials.png

When you select the "Direct Spatials" mode for displaying the object's location, Quick Properties shows you the values that are stored in the tree for the location of the object. If you rotate an object, you'll notice that the object's location doesn't change (only its rotation changes):

99-direct-spatials2.png

The location edit mode in Quick Properties enables you to specify a location based on a certain reference point. For example, if you specify the upper planar midpoint as the reference point, then the location will be shown as (3.69, -1.5, 2) for the object above, instead of the (0, 0, 0) that is its actual location that is stored in the tree. You can then edit the location based on that reference point instead of the direct spatial location.

100-planar-mid-point.png

The object's location in the tree will still be stored as the "Direct Spatials" values, but this option enables you to enter the location based on a certain reference point.

You can also set the location dynamically based on these reference points using the Set Location pick option:

101-set-location.png

Here, you can specify a reference point similar to the Quick Properties window:

102-set-location2.png

The command setloc() also takes 3 optional parameters. If you do not use these parameters, it sets the location directly, based on the "Direct Spatials" mode. If you use these three optional parameters, it sets the location based on a reference point within the yellow bounding box (as specified by 3 factor values between 0 and 1).

You can also use the command setcenter() to set an object's location based on its center point. This would be the same as setloc with 0.5 for each optional parameter:

setcenter(object, xloc, yloc, zloc);
setloc(object, xloc, yloc, zloc, 0.5, 0.5, 0.5);


Phil BoBo
Sr. Manager, Software Development
Message 3 of 9

wproctorPG49C
Enthusiast
Enthusiast

Thanks for the clarification on this works. I can see how to change the value. It impacts the location displayed on the screen, but it doesn't seem to have an affect on the dispatch command that I am using "inserttask(ts,TASKTYPE_TRAVELTOLOC,NULL,NULL,x,y,z,0).

I'm trying to end up with the front center of the Task Executor aligned with the X,Y,Z coordinate when I get to the location but it is still using another location within the object for this task (center?) (I've moved the reference point to several locations to see the affect)

What point within the object boundary is used when doing a TRAVELTOLOC command?

0 Likes
Message 4 of 9

philboboADSK
Autodesk
Autodesk

The point used in a Travel To Loc task depends on the TaskExecuter. An operator travels differently than an ASRS or a Crane, etc. Can you post a small example that shows what you are actually trying to do?



Phil BoBo
Sr. Manager, Software Development
Message 5 of 9

wproctorPG49C
Enthusiast
Enthusiast

I can use an operator instead of a TaskExecutor if that makes things easier. Essentially I'm creating a piece of equipment that can be flexibly routed anywhere on the field without a path network..

0 Likes
Message 6 of 9

wproctorPG49C
Enthusiast
Enthusiast

OK. That does seem to work. Will my vehicle rotation location center then be at the same location? If so, is there a way to move it between the rear wheels? Thanks.

0 Likes
Message 7 of 9

philboboADSK
Autodesk
Autodesk

Attached is a model that uses a BasicTE to customize the offset location so that it drives the front of the yellow box to the location specified in the Travel To Loc task.

You could use this BasicTE as your Combine instead of the TaskExecuter object so that it rotates as normal, but travels to the edge of the yellow box.



Phil BoBo
Sr. Manager, Software Development
Message 8 of 9

wproctorPG49C
Enthusiast
Enthusiast

Thanks Phil. I'll take a look.

0 Likes
Message 9 of 9

philboboADSK
Autodesk
Autodesk

This forum works a little different than our other user forum in that each "Answer" is meant to be an actual answer to the question, not a reply to a previous post. Post-reply conversations are meant to be done in the comments of each answer. This makes answer finding easier for people who are skimming. So I've converted your answers into comments.



Phil BoBo
Sr. Manager, Software Development