Jump to content

X and Y Coordinates


Recommended Posts

I would like to illustrate the X and Y coordinates of a symbol within the symbol itself. I have been experimenting with the XCOORDINATE and YCOORDINATE functions in worksheets (probably incorrectly) using a worksheet to report those values back to the symbol via a text record, but that doesn't seem to work. I am sure I could make it work though if I knew the correct formula to use.

Does anybody have a solution to this? It seems such a simple thing to want to do.

(I don't want to use a label legend if at all possible)

Mark

Link to comment

Mark,

What type of symbols? After seeing your post I did an experiment with Marionette. With some help from Marissa in the Marionette forum I was able to make this Marionette object which adds the coordinates to a symbol instance. As you drag it around, the coordinate text updates.

I realized after that you might be trying to do this with lighting objects. Not sure if it will work but you could try it.

Kevin

ubbthreads.php?ubb=download&Number=16120&filename=Screen%20Shot%202016-08-04%20at%202.46.48%20PM.png

Edited by Kevin McAllister
Link to comment

Mark

If you're trying to do this with spotlight symbols, it's already built in. Just create a label legend that uses the X,Y,&Z positions.

If you're trying to do this with one of your own symbols it's a two step process. And you're already on the right track. Kevin wrote a marionette script to connect the XCoordinate to a database. Or maybe he skipped that part and just put text in the middle of the symbol.

Here's how you make the connection w/o scripting:

1 Create a record format with fields for the X, Y, and Z coordinates. Attach the record format to the symbol. Add dummy text to the symbol definition. Link that text to the X, Y and Z fields.

2. Create a worksheet with a database who's criteria is objects with that record format. Call the X, Y, and Z fields. Then in 3 additional columns, call the functions =XCoordinate, =YCoordinate, and =ZCoordinate.

Select all the cells in the XCoordinate column, copy and paste them into the cells for the X position record format field. Make sure you copy and paste the same number of cells or it gets unhappy. Repeat for Y and Z.

Obviously if you do this a lot scripting is the way to go. But if you need to get the drawing out today, the worksheet is way faster.

I'll attach a simple example.

hth

mk

Link to comment

Dear Kevin and Michael

Thanks so much for taking the time. The scripting version is what I am ultimately going for but I need to learn Marionette to do this and this is going to take some time! The worksheet way is certainly the way to do it for now. What I was attempting to do with the worksheets is to find a formula to copy the XY data into the columns that reference the text record that I made. I guess that is not possible?

I will read carefully the forum post you made Kevin and "reverse engineer" your marionette script as a start to my learning process.

All the best

Mark

Link to comment
... of a symbol within the symbol itself.

Mark

I think that is forbidden :)

This is not what a Symbol is thought for.

Symbols instances are not meant to be similar, they are totally equal.

They are virtual. The Symbols content exist only in the Symbol Library

exactly one time. Its Instances are just stored positions and orientations

that will happen in the drawing and show that original content.

Therefore, for example, it does not work if you put Walls with relative

heights bound to story levels into a Symbol. If you set an Instance

to a story with other story+level heights, it the walls can't know about

that and adapt.

Link to comment

Oh, I did not read what I quoted.

No problem with nested Symbols itself.

I was talking about contents in Symbols that use some relative qualities that

should make Symbol instance copies look different from the parent Symbol

in any way later when placed.

So I also wonder that there could be kind of such behavior in Spotlight Light Symbols.

Perhaps Marissa can put some light on this.

Link to comment

Mark

I don't know why I keep forgetting that this feature now exists. You can now run scripts directly from worksheet cells. This puts the position into a friendlier format that copies from one cell to another better. You still have to do it manually, but it seems to be handle the foot / inch conversion better. I'll attach an example. This one formats the labels on the symbol and the worksheet cells better. Those readers who are metric users and don't understand why I'm dividing by 12… We know it's crazy.

Not sure what you mean by referencing the data to a text record. You can write a script that takes any data about a symbol and writes it to a database field defined by a record format. That's not very difficult. But do you need the coordinate value (a real number) to be converted to text? (Also not difficult.)

Zoomer

Spotlight has it's own labeling tool for spotlight instruments that allows any data point to be inserted into the parametric object an any relation to the symbol and still have each label be individually adjustable per object. (I often wish this could be used for doors, windows, and space objects.)

hth

mk

Link to comment

I have attached an example of what I am aiming to achieve. I was trying to do something so that when I move the "marker" symbols around, the X/Y fields update automatically without too much of a headache with scripting and was hoping that a worksheet would do that without having to cut/paste!

Thanks for being so helpful. I can see that scripting is the way to go, so now I just need to learn how to do it!

Mark

Edited by markdd
Link to comment

Take a look at this script. Move a boom or add another one and run the script. It will put the current position into the label.

If you want to get fancy you could have it recognize SL from SR (or PS from OPS) and remove the negative X values on SR.

You could still build a marionette to do this. And this script may help provide a roadmap.

hth

mk

Edited by michaelk
Link to comment

This is great!

One thing I noticed is that when the marionette object uses a symbol with a record format attached, the instances of the symbol used are not seen by the worksheet referencing the record format. Is this intentional do you think?

Just answered my own question! Update the criteria in the worksheet to include plug-in objects!!!

BTW, the Marionette object you have created is a fantastic way for me and hopefully others to help understand the scripting art that I had never thought I could get to grips with. Thanks so much!

Mark

Edited by markdd
Link to comment

One thing I noticed is that when the marionette object uses a symbol with a record format attached, the instances of the symbol used are not seen by the worksheet referencing the record format. Is this intentional do you think?

Just answered my own question! Update the criteria in the worksheet to include plug-in objects!!!

Well actually its not quite there yet! I can get enter text into a record format attached to the symbol the marionette object uses with a worksheet, but when I move the marionette object (that uses the symbol), the data in the text field disappears) So I was wondering if there was a way of getting the corresponding data from the worksheet into the marionette object.

See the attached file to see where I am at...

Link to comment
  • Marionette Maven
Kevin, Hi, nice work.

When i move this one around I get this error message and graphics drop out.

Any ideas??

Interesting. I haven't had any problems with it here. I wonder if its a PC specific error. Maybe Marissa will know.

Kevin

I'm not experiencing this on my end. Alan, did you make any changes to the file on the machine that you're experiencing the error? The error is referring to incorrect wiring to a node that needs a particular object type - I can't narrow down which one from the error unfortunately.

That is strange. Maybe there's something different about the installations of Python. Or you've found a bug of some sort....

KM

There should be no differences with the Python installations. Plus this error refers to a Vectorscript error.

Link to comment
Well actually its not quite there yet! I can get enter text into a record format attached to the symbol the marionette object uses with a worksheet, but when I move the marionette object (that uses the symbol), the data in the text field disappears) So I was wondering if there was a way of getting the corresponding data from the worksheet into the marionette object.

See the attached file to see where I am at...

Mark,

Here's a link to a file with a couple of approaches - https://dl.dropboxusercontent.com/u/33783259/Example_4_KM.vwx

Apparently Marionette Objects create largish files....

You need to give the Set Record Field node an object. In one version I assign the records to the Marionette Object itself. In the other I assign them to the symbol (this version also generates an extra object, I'm not sure why, it may be the Marionette Object itself).

I think this Marionette Object can only be one directional - eg. it assigns the value to the record format or it takes info from the record format. I'm not sure it can do both because it would create a loop. Marissa would know more about if this is possible.

It might make more sense to link the text that's created by the Marionette Object to the Database record. Not sure.

Kevin

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...