Jump to content

orso b. schmid

  • Content Count

  • Joined

  • Last visited

Community Reputation

22 Great


About orso b. schmid

  • Rank

Personal Information

  • Occupation
  • Homepage
  • Hobbies
  • Location

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello, labels are just as old as MiniCad. You won't see any change there. Raymond Mullin will able to point you to very good literature about PASCAL. If he's not following this thread already, I'll send him a note to come here and help you. If GOTOs don't work as expected, you are making some mistake in their scope. And then they work unpredictably. I seem to understand that you are using GOTO globally in your whole script. That will not work. As a principle GOTO statements are only good within a singular routine. No more. You won't be able to solve this problem until you switch to a different script structure. More subroutines, IF and CASE conditions.
  2. orso b. schmid

    Drawing "Page Based" objects with Plug-In Object?

    No, sorry Arshan, that can't go well. What happens when you display in Viewport with another layer scale? Nothing. Wrong display since the object won't regen. And anyway you would need an event enabled plug-in with regen on layer scale change also for a correct display on design layer. Otherwise there will be no conversion. kObjXPropHasLayerScaleDeps = 2; { Object wants to be reset with when its layer scale changes. // Boolean Property } Did you actually try to use the symbol flag on your Pio? It might work. /SDKLib/Include/Kernel/MiniCadCallBacks.h const short ovSymDefPageBased = 130; // Boolean - whether the symbol will have a constant page size, meaning it will have the same size
  3. Please read well what I wrote: I said that ValidNumStr supports units. Not Str2Num. The two are different. Going back to the sub, you'll want to use a sub that returns the number right away instead of a boolean and that's why you define that sub.
  4. If you have a parameter of type dimension, that takes care of the units and you need no conversion. Whenever you use values that are subject to units, you should really take exclusively parameters of type dimension. You don't need to use Str2Num, ValidNumStr -also in its standard version- supports units and it's a more modern call. Making it a sub has the advantage of having it return a number instead of a boolean value. It is an old standard subroutine from my collection here: http://www.vectorlab.info/index.php?title=Util-Valid_num_or_zero You don't have to redefine the standard routine, you can define your one as you please and call it something else. I think it is better. You can look also at this one, for example: http://www.vectorlab.info/index.php?title=Util-Valid_num_enhanced I don't write the documentation, I just document VectorScript quirks on dev. Before that I did it on Vectorlab. Lucky you that you find easy to follow GOTOs, I don't! Anyway, as it is stated in the current documentation, LABELS are unpredictable if used outside their scope. Keep that in mind and all is well. Ciao, Orso
  5. Hello Sean, I have no idea why on Dev there is written to actually override Str2Num. You don't have to. I don't know who wrote that. You CAN override it, but don't have to. I will add now a warning note on dev. Please don't override stuff if you don't feel comfortable with scripting. BTW, GOTO are more difficult to handle than, say, CASE or IF conditions. This sounds quite surreal to me. I open now the guide which I found here. It states: GOTO statements have several cautions which must be observed whenever using them: GOTO statements can only transfer execution within the same procedure, function, or main body of a script. They cannot be used to jump between procedures or between scripts. The destination of a GOTO statement must always be the beginning of a statement. Jumping to statements that are contained within the structure of other statements can have undefined effects; the VectorScript compiler will not recognize this action as an error. I used them myself only a handful of times. I think you'll do yourself a favour dropping them and eventually coming back to it when you feel more comfortable with VS. Ciao, Orso
  6. orso b. schmid

    Save File As

    Laurum, do you know our Developer wiki? It's great: http://developer.vectorworks.net/index.php/VS:SaveActiveDocument
  7. orso b. schmid

    Save File As

    Hello, speaking about SaveActiveDocument, this is from my own notes from VW 12 (now is 24, so it was 12 versions ago): It corresponds to "save as" but without dialog. Saving on the same file path name doesn't work (returns -1), only if the file path is different (returns 0).
  8. orso b. schmid

    Applying a Tile Resource to a Polygon

    Julian, it is indeed so tricky. You must first check for the by class of the fill type. Otherwise GetComponentFill will return the fill type of the component, "below" the by class. Edit: here the test file: wall comp fill style test.vwx.zip Example: PROCEDURE TEST; VAR sty : HANDLE; i, numComponents : INTEGER; resIndx : LONGINT; useClassFillStyleForFill : BOOLEAN; className : STRING; FUNCTION ResolveFillIndex(indx : LONGINT): STRING; BEGIN CASE indx OF 0 : ResolveFillIndex := 'none'; 1 : ResolveFillIndex := 'solid'; OTHERWISE ResolveFillIndex := Index2Name(-indx); END; END; BEGIN sty := GetObject('sty'); { a wall style named 'sty' with some components } { some have a fill by class, some don't } IF GetNumberOfComponents(sty, numComponents) THEN FOR i:=1 TO numComponents DO BEGIN useClassFillStyleForFill := FALSE; { init } { check if it's by class } IF GetCompUseClassFill(sty, i, useClassFillStyleForFill) THEN IF useClassFillStyleForFill THEN IF GetComponentClass(sty, i, resIndx) THEN BEGIN className := Index2Name(resIndx); AlrtDialog(Concat( 'Component ', i, chr(13), 'Has fill by class. Class name: ', chr(13), className, chr(13), 'Fill: ', ResolveFillIndex(GetClFPat(className)) )); { the underlying fill, without the by class } IF GetComponentFill(sty, i, resIndx) THEN AlrtDialog(Concat( 'Component ', i, chr(13), 'UNDERLYING Fill, if it wasn''t by class: ', chr(13), ResolveFillIndex(resIndx) )); END; IF (useClassFillStyleForFill = FALSE) & GetComponentFill(sty, i, resIndx) THEN AlrtDialog(Concat( 'Component ', i, chr(13), 'Fill indx not by class: ', chr(13), ResolveFillIndex(resIndx) )); { index 1: solid fill } { index negative: vectorial fill: hatch, tile, img, gradient } END; END; RUN(TEST);
  9. orso b. schmid

    Applying a Tile Resource to a Polygon

    Just by reversed index: SetFPat(PolyHandle, -Name2Index('tileFill'));
  10. orso b. schmid

    Scripting stories

    Hello, I finally made a manager for stories for transferring story data across documents. There are a few relevant limits, but it is roughly possible to get a decent command doing the bulk of the job. A couple of things are not clear to me: Does anybody know if there is a difference between these two? * VW 17 (2013): GetStoryLayerInfo(index: INTEGER; VAR name: STRING; VAR scaleFactor: REAL; VAR layerLevelType : STRING; VAR elevationOffset: REAL; VAR defaultWallHeight: REAL): BOOLEAN; * VW 20 (2015): GetLevelTemplateInfo(index: INTEGER; VAR layerName: STRING; VAR scaleFactor: REAL; VAR levelType: STRING; VAR elevation: REAL; VAR wallHeight: REAL): BOOLEAN; I don't see any difference, and I tested really extensively. But, as always, I might be missing the obvious. 🙂 Does anyone know how to check if the suffix is actually used as a prefix? Thank you, Orso
  11. orso b. schmid

    Post-Brexit support for UK VWX architects

    The things one says for greed.
  12. orso b. schmid

    NumCustomObjectChoices(pioName, pParamName)

    Dear Sam, can it be that you are running it too early? Not in kParametricRecalculate?
  13. orso b. schmid

    Messages and Includes

    Julian, is this what you are looking for? {$INCLUDE ..\BlaBla.vss} --> go up 1 folder from current file location (= file containing the running script) . {$INCLUDE ..\..\BlaBla.vss} --> go up 2 folders from current file location {$INCLUDE ..\..\MyFolder\BlaBla.vss} --> go up 2 folders and enter MyFolder from current file location Edit: this is platform independent.
  14. orso b. schmid

    VW 2017 Network Setup

    I always wanted to write something for team work in VW, postpone this since years. It would take some time, not last because workflows are very different depending on national habits/rules and output.
  15. orso b. schmid

    VW 2017 Network Setup

    Jim, if I was to start enumerating the times you gave me/us reason to thank YOU!


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.