Jump to content
Developer Wiki and Function Reference Links ×

Create Focus Points from objects or text

Recommended Posts



Although I have been using Vectorworks for many years I have never had cause to venture in to the world of Marionette and am looking for a little guidance.


I have an imported DWG file that has a number of focus positions denoted by a circle and a text numerical reference.


I would like to try to write a Marionette script that will take the centre point of these text objects and create focus points at those coordinates, and ideally take the text and use it as the focus point name.


Id be grateful for any pointers to set me in the right direction.





Edited by kduncan
Link to comment

Unless there is something special about those object (color, layer, class, attached record or field value), you are not going to have much luck with scripting them beyond manually selecting them and running the script. Unless the circle and text are in a block of some kind, it is going to be very hard to script getting the correct text Data to use as the focus point name.


Unless you get these files on a regular basis or this file has a huge number of points, I doubt it is worth it unless you really want to use it as a learning exercise.


My first guess is that you will spend at least 4 to 10 hours to make a script or marionette that will work. I would think you could manually create a lot of focus points in that time.


HTH. If you really want to do it, post a file with a couple of the circles and text blocks and we can see if there is a way to automate it.







Link to comment



Thanks for the response.


This is primarily a learning exercise, but for the current project I am involved with there will be quite a few of these files coming in with varying numbers of text blocks up to the many hundreds, so it would be nice to streamline the process.


Getting the relevant text (I discarded the circles) isolated in to their own class is quick and easy.

I have been working on a script using reference from a script by Timothy Besada another member on here who made a script for generating focus points for arrays of lights. (I hope that isn't agains board rules)


So far I have managed to make it create focus points at the text block locations but can not get the text to become the focus point name.


Once again many think for any help, and no worries if not.







Focus Points from Text test .vwx

Link to comment

Hi Keith,


You have made a great start. I don't have enough time (or maybe enough skill) to figure out the full marionette tonight, but one thing I did see is that you have the wrong field name. The String node setting the field name is passing Text instead of the Field Name which is just Name.  The other field and record names look correct.


I made the change on my copy and still got focus points names A to H.


Good luck and ask again. I am sorry I was a bummer earlier. I am always glad to help anyone who is trying to help themselves. I just occasionally get frustrated at the people who want 40 hours of someone else's time to solve a 10 minute problem for them.



Link to comment

Hi Pat.



Thanks for taking a look, I have updated the field name String that you mention and am still seeing the names A to H also, I have played about with the Replace String node and a few others, but seem to be getting nowhere. 


No worries, appreciate you having a look, am enjoying starting to understand a bit about Marionette, having never had to venture in to a scripting world before its very interesting.



Link to comment

My guess is the the focus point is actually being created after you name it. In Vectorscript, there is a Redraw command that will kind of update/create objects before the script ends. I don't think there is a similar function in Marionette.


Try moving the naming step to the very end of the network and see if that works.



Link to comment

I have tried shuffling the nodes around to put the name at the end, but it still isn't happy, I wonder if there is an link in the Focus Point that requires there to be a lighting instrument in order to assign the name.


Thanks again for the help, but your chart in your first relay is definitely looking more true.



Link to comment

Hi again Pat.


I got it, 3rd cup of coffee moment.


Thanks again for the prodding, it was actually that the naming step had to be nearer the beginning.


Its not very elegant and still a few things that aren't quite right but it does what I set out to do. Which is lucky as I have just had a DWG sent over that as over 1300 points on it that need converting. I think my time to productivity ratio just improved.





Focus Points from Text Working .vwx

Edited by kduncan
Completing the message
  • Like 1
Link to comment
  • 3 weeks later...
  • Vectorworks, Inc Employee

I am coming in a little late to this conversation but I created a network for Landmark users a while ago that sounds very similar to what you want. Now that you have gotten started, you may not need this, but it might still be a helpful resource.



Link to comment
  • 2 months later...

Hi Guys

I'm struggling with a very similar issue. 


I have a textfield and a 2D symbol. The textfield shows the hight (z-coordinate).

So it's basically a cross in form of an 2D symbol and next to it, there's the textfield with the numbers. It's a classical example of showing highpoints in 2D like anno 1864.

What i need is a script which takes first the x- and y-coordinate from the textfield.

Then takes the content from the textfield and converts it into the z-coordinate. 

And then I want to convert the textfield into an intellegent object like the focus points. 


is there a way to modify the script of kduncan? or should i start from the beginning?



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.

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...