Jump to content

Search the Community

Showing results for tags 'function'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Announcements
    • Announcements
    • News You Need
    • Job Board
  • Feedback
    • Wishlist - Feature and Content Requests
    • Known Issues
    • Wishes Granted
  • General
    • Troubleshooting
    • General Discussion
    • Architecture
    • Site Design
    • Entertainment
    • Vision and Previsualization
    • Braceworks
    • Rendering
    • Workflows
    • Buying and Selling Vectorworks Licenses
  • Customization
    • Marionette
    • Vectorscript
    • Python Scripting
    • SDK
    • 3rd Party Services, Products and Events
  • Solids Modeling and 3D Printing
    • Subdivision
    • Solids Modeling
    • 3D Printing
  • Vectorworks in Action
  • Archive
    • Resource Sharing
    • Machine Design
    • Terms of Service and Community Guidelines

Categories

  • Knowledgebase
    • Tech Bulletins
    • Troubleshooting
    • Workflows
    • How To
    • FAQs

Categories

  • Marionette - Objects
  • Marionette - Networks
  • Marionette - Nodes
  • Marionette - Menu Commands

Product Groups

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Occupation


Homepage


Hobbies


Location


Skype

Found 3 results

  1. I am trying to develop an SVG reader in Vectorscript, but I am at a stake because of the impossibility to manage functions or procedures that calculate and return strings that may have more than 255 chars. Having to do with SVG commands like this… <path fill="none" stroke="#000000" stroke-width="0.238" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-dasharray="1,1" d=" M47.506,645.356c0.099,0,0.197-0.049,0.296-0.049c0.098,0,0.196-0.05,0.295-0.099s0.197-0.049,0.296-0.099 c0.098-0.049,0.196-0.099,0.246-0.147c0.098-0.049,0.196-0.099,0.246-0.147c0.098-0.05,0.147-0.099,0.246-0.148 c0.099-0.049,0.147-0.147,0.246-0.196c0.049-0.05,0.147-0.148,0.196-0.197c0.05-0.049,0.148-0.147,0.197-0.246 s0.099-0.147,0.197-0.246c0.049-0.099,0.098-0.147,0.147-0.246c0.049-0.099,0.099-0.197,0.147-0.295 c0.05-0.148,0.147-0.296,0.197-0.493c0.049-0.147,0.099-0.295,0.196-0.492c0.05-0.147,0.099-0.345,0.148-0.492 c0.049-0.196,0.147-0.442,0.196-0.64c0-0.05,0.05-0.147,0.05-0.197c0-0.049,0.049-0.147,0.049-0.197 c0-0.049,0.05-0.147,0.05-0.196c0-0.05,0.049-0.147,0.049-0.197c0-0.049,0-0.049,0-0.099c0-0.049,0-0.049,0-0.098 c0-0.05,0-0.05,0-0.099c0-0.05,0-0.05-0.049-0.099c0-0.049-0.05-0.049-0.05-0.049l-0.049-0.05l-0.05-0.049 c-0.049,0-0.049-0.05-0.099-0.05c-0.049,0-0.049,0-0.098,0c-0.05,0-0.05,0-0.099,0c-0.05,0-0.05,0-0.099,0s-0.049,0-0.099,0.05 c-0.049,0-0.049,0.049-0.099,0.049l-0.049,0.05l-0.049,0.049c0,0-0.05,0.049-0.05,0.099c0,0.049-0.049,0.099-0.049,0.147 s-0.05,0.099-0.05,0.147c0,0.05-0.049,0.099-0.049,0.148c0,0.049-0.049,0.098-0.049,0.147c-0.05,0.099-0.099,0.246-0.197,0.345 c-0.05,0.099-0.099,0.246-0.197,0.345c-0.099,0.147-0.147,0.246-0.246,0.394s-0.147,0.246-0.246,0.394s-0.197,0.246-0.246,0.345 s-0.147,0.147-0.197,0.246c-0.049,0.099-0.147,0.147-0.196,0.197c-0.05,0.049-0.147,0.147-0.197,0.196 c-0.049,0.05-0.147,0.148-0.246,0.197s-0.147,0.099-0.246,0.147c-0.099,0.05-0.147,0.099-0.246,0.148 c-0.099,0.049-0.197,0.098-0.246,0.147c-0.099,0.049-0.197,0.099-0.296,0.147c-0.147,0.049-0.295,0.099-0.442,0.147 c-0.147,0.05-0.296,0.099-0.443,0.148c-0.147,0.049-0.295,0.098-0.443,0.147c-0.098,0.049-0.196,0.049-0.295,0.099 c-0.099,0-0.197,0.049-0.296,0.049c-0.049,0-0.147,0.049-0.196,0.049c-0.05,0-0.147,0-0.197,0.05c-0.049,0-0.147,0-0.196,0.049 c-0.05,0-0.148,0-0.197,0.05c-0.05,0-0.05,0-0.099,0s-0.049,0-0.099,0.049c-0.049,0-0.049,0.049-0.049,0.049l-0.05,0.05 l-0.049,0.049c0,0.05-0.049,0.05-0.049,0.099s0,0.049,0,0.099c0,0.049,0,0.049,0,0.099c0,0.049,0,0.049,0,0.098 c0,0.05,0,0.05,0.049,0.099c0,0.05,0.049,0.05,0.049,0.099l0.05,0.049l0.049,0.05c0,0,0.05,0.049,0.099,0.049s0.049,0,0.099,0.05 c0.049,0,0.049,0,0.099,0c0.049,0,0.099,0,0.147,0s0.099,0,0.147,0c0.05,0,0.099,0,0.147,0c0.05,0,0.099,0,0.148,0 c0.147,0,0.295,0,0.442,0c0.148,0,0.296,0,0.443,0s0.345,0,0.492-0.05c0.147,0,0.345-0.049,0.492-0.049 C47.161,645.406,47.359,645.406,47.506,645.356z”/> … that goes very beyond the 255 chars strings limit, I had necessarily to substitute functions returning strings into functions returning dynarray[]of char, but this is FORBIDDEN. So I tried with procedures returning dynarray[]of char as VAR (this is allowed) but I found strange behaviors. For example, the following script takes the constant string (this is a short string, just for instance). The first procedure extracts the substring starting from 'points="' and the subsequent '"'. The second procedure replaces the commas with spaces. Both procedure uses the same VAR s:string declared. procedure test; const polygon = '<polygon points="35.938,135.145 36.233,140.511 36.971,140.511 36.971,135.145 "/>’; {this is just an example of SVG line, this is < 256 chars, but this is a special case} var s: dynarray[]of char; {declare the VAR I'll use later as value returned from procedures} {*********************** scanPolyPoints **********************} {return the substring between 'points="' and '"', I'll split these points later} procedure scanPolyPoints(parameter: string; line: DYNARRAY[] OF CHAR; var r:DYNARRAY[] OF CHAR); var index1, index2: integer; temp: DYNARRAY[] OF CHAR; begin {search the position of 'parameter='} index1 := Pos(parameter, line)+1+len(parameter); temp := copy(line, index1, len(line)-index1); {remaining string} {search the position of '"' in the remaining string} index2 := Pos('"', temp); temp := copy(temp, 1, index2-1); {here I have only the string composed by points} r := temp; {set the answer r} end; {*********************** replaceCommas **********************} {substitute each comma with a space and each minus signs with ' -'} {in the SVG (generated by Adobe Illustrator), the path numbers are separated by a ',' or by '-' or by a space} {whenever you find a '-', the ',' is omitted!} procedure replaceCommas(source:dynarray[]of char; var dest: dynarray[]of char); var i:integer; temp: string; begin temp := ''; for i:=1 to len(source) do begin if source[i] = ',' then temp:=Concat(temp,' ') else if source[i] = '-' then temp:=Concat(temp,' -') else temp:=Concat(temp,source[i]) end; dest := temp; end; begin s := ''; {init} writeln(polygon); {write the input string to the standard output} scanPolyPoints(' points=', polygon, s); {first procedure} writeln(s); {write the resulting "s" string to the standard output} {Now I use the variable s both as parameter and resulting var} replaceCommas(s, s); {second procedure, commas should be replaced by spaces} writeln(s); {but NO! It's unchanged} {test it with a constant string as parameter…} replaceCommas('.,.,.,.,.,.,.,', s); writeln(s); {…it works!} end; run(test); The resulting output is the following: <polygon points="35.938,135.145 36.233,140.511 36.971,140.511 36.971,135.145 "/> 35.938,135.145 36.233,140.511 36.971,140.511 36.971,135.145 35.938,135.145 36.233,140.511 36.971,140.511 36.971,135.145 . . . . . . . As you can see, the first procedure works (line 2), the second no (line 3 has still commas in place!). While the constant string has the commas removed (line 4). Where is the problem and, most of all, is there a solution? Thank you for any help. Paolo Marcuccetti
  2. Hello, I've been trying to create a construction budget template that I can use in different projects and I need a lookup function for cell referencing. Some time ago I tried to write a python script that could do this for me but I could not get the code to work because of some issues including my lack of knowledge in programing. Here's a link to the discussion about the script where I explain in more detail what this function should accomplish: In other spreadsheet programs I can use this function, in Excel there is the VLOOKUP and HLOOKUP functions, in google sheets as well. I could export information from VW and do my budgeting in other apps but I would really like to do all inside VW.
  3. I would like to be able to export to pdf from a script without having to prompt the user to choose pdf settings and a location or filename for the files. Currently the only way to do it is to call these functions like this: vs.AcquireExportPDFSettingsAndLocation() vs.OpenPDFDocument(inFilenameStr) vs.ExportPDFPages(savedViewNameStr) vs.ClosePDFDocument() Could we we have an alternative to the first function like this: vs.SetExportPDFSettingsAndLocation( location, dpi, blah, blah, etc)
×