KristjanT Posted December 1, 2023 Share Posted December 1, 2023 Hi! Is it possible somehow to extract text objects (height values as plain text) to XML file containing the X; Y location value and the text "value" itself? Example of the output data is done in AutoCAD. The main goal is to get source data for side model generation. Would really like to skip the AutoCAD part of the workflow. Quote Link to comment
Pat Stanford Posted December 1, 2023 Share Posted December 1, 2023 Create a one line Vectorscript named TheText. (Resource Manager, New Resource, Script) WSScript_SetResStr(GetText(WSScript_GetObject)); Create a worksheet and a database row specifying the text objects (probably by layer or class and object type) you want to see they should show up as subrows ie 3.1, 3.2, etc.) Enter formulas of =XCenter =YCenter =RunScript('TheText') HTH 2 Quote Link to comment
KristjanT Posted December 4, 2023 Author Share Posted December 4, 2023 It worked. Thank you! Quote Link to comment
KristjanT Posted December 5, 2023 Author Share Posted December 5, 2023 Is it possible to make the X;Y coordinate not read from the centre of the text but for example from the left lower corner? Sorry, really new in this part of the Vectorworks. Quote Link to comment
Pat Stanford Posted December 5, 2023 Share Posted December 5, 2023 The only built in function for the worksheet for location of the insertion point or the center. For Text this these are the same. To get the bottom left would require additional worksheet scripts that will make your worksheet even that much less maintainable. But if you need it I will see what I can do. Quote Link to comment
Pat Stanford Posted December 5, 2023 Share Posted December 5, 2023 Actually I am wrong. There are four worksheet functions you might want to know about BotBound TopBound LeftBound RightBound These will provide the extents of the bounding box. This is different than the exact position of the edge of the text because it includes some margin, but is effectively the same thing I was looking to do with a script. BotBound instead of XCenter LeftBound instead of YCenter Will get you about as close as you are going to get without converting the text to poly lines. 2 Quote Link to comment
KristjanT Posted December 6, 2023 Author Share Posted December 6, 2023 Sound like it will do the job. Will try it out. Thank you! :) Quote Link to comment
Recommended Posts
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.