-
Posts
796 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Everything posted by Hippocode
-
Is it possible to sort on multiple structure fields ? The same way you can sort in order in worksheets.
-
I've got a shortcut "scripts" in my vectorworks application folder that points to our network drive. My palette scripts use included files from scripts/filename.vss. I can only manage to do so with a shortcut, I can't open scripts directly from my vectorworks folders or anywhere else ? An error that files can't be opened, yet they have all permissions and can be found. ( The error is not the same as "file not found".) btw, it seems that sharing custom PIO's is also possible, with a shortcut to each PIO. Shortcuts have to be placed in the application plugin-folder and must have exact the same name as the PIO. This is how I share all our tools with colleges, without them having to update on each change
-
Trying to reference a worksheet from an existing file.
Hippocode replied to MaxStudio's topic in General Discussion
That's because you can't permanently change items in layers from FileA while being in file B. The same as you manually go to those referenced layers you get the message your changes will be undone the next time you update or reopen the file. For that you would need the same worksheet in both files. -
I always get that whenever I save directly to a hard drive on the network. All files get corrupt like that.
-
Trying to reference a worksheet from an existing file.
Hippocode replied to MaxStudio's topic in General Discussion
I don't think its possible what you're trying to do. What I do, is keeping the original worksheet in FileB. As the referenced layers from FileA update, so does fileB, and when recalculating the worksheet the changes will become visible in FileB. I also change the worksheet in FileB only, as you don't need it in A anyway. But I understand its not so "user-friendly" uh -
Vectorscript Development Tools for Windows: Notepad++
Hippocode replied to brudgers's topic in Vectorscript
Might be a late bump, but thanks for this. The folding doesn't work here, but the colours etc do -
I'm looking into placing a long text (>255) into a dialog popup window. I assumed creating the dynarry of char trough this way would work, and it does, but the alrtdialog seems to ignore the string when its too big, I guess on 255 chars. PROCEDURE TestString; VAR aString : DYNARRAY[] OF CHAR; BEGIN aString:=concat('print some text',chr(13)) FOR i:= 1 TO.... aString:=concat(aString,'text',i,chr(13)); END; Message(aString); AlrtDialog(aString); END; run(TestString); can dialogs only accept strings ?
-
I doubt a newer version would change the type of parameters. A lot of data in most objects is passed as a string, even if it stands for a number. The reason is , unless its a dimension you can't have a "REAL" value, thus strings are often used (and converted afterwards) to solve that. If you are retrieving that data trough a dbrow into a worksheet, you could use "VALUE(RecordName.FieldName)" to make the string "7" into number 7. Trough script it would be Str2Num(); and Num2Str(); If you don't have "enough" fields to save all of your custom data, you can add parameters yourself, but again bound to the above described. But for your numbering, you could easily add a field as an integer. These parameters should be visible in the object info palette but can't be used in the script of the object itself. For that you will need to code your own spaceobject..
-
Check Box to include/remove a PIO from a report database?
Hippocode replied to MaxStudio's topic in Vectorscript
Is that report a databaserow in a worksheet that lists all those objects ? Do you want that object to have that checkbox, or the report itself ? You might try adding a checkbox in the pio, write the code in it that will delete the PIO when true. VS:DelObject might work? This way you could change that value in a report with result the deletion of the object. Worksheet might need a recalculation afterwards. -
Those files are referenced. You can choose between absolute or relative, I took the last one so each project has the same folder hierarchy. Layers and resources can be used between several drawings, I actually like the way it works. I've linked these files in several ways that each file can "see" some parts of the others. The masterplan itself contains everything. When referenced layers are edited while using them, an update button will refresh the updates from your co-workers directly in your drawing..
-
We split our drawings into multiple files, all referenced in one masterfile. This way we can have multiple coworkers work on the same project ( but not on the same subfile ). Files are stored on our network. I'm not aware of a better method
-
vertical screen menulist of: Restore Move Size Minimize Maximize Close doubleclicking the icon closes VW.
-
I also import my drawings into our newer templates. But we use a lot of saved views and they also get lost when importing these layers. It's a choice between "renaming the layers before importing and copying the content to the right layers", or "importing them and recreating all the corresponding saved views", importing saved views is a no go either. A choice we shouldn't have to make..
-
Script to list all symbols in an area
Hippocode replied to Hippocode's topic in Resource Share - Vectorscript
Here you go.. I've added a popup that shows which layers get compared on each turn, so you'll understand it better when changing the script to use your Layers. The code now, loops from number Z="0" upto "+2". From that, it generates 2 layer names, the one with the spaceobjects on and the one with the symbols. I use "niv Z WVB" as the spacelayer and "niv Z elektriciteit" as a layer with my symbols. Z being the changing number. Edit that so it works on your personal layers. Don't forget to change the record and field name again. In the comparison part, where I check the location of the symbol within a spaceobject I use the following code: IF (PtInPoly(x,y,PolyHandle[i])) AND (PtInPoly(x,y+1,PolyHandle[i])) AND (PtInPoly(x+1,y,PolyHandle[i])) AND (PtInPoly(x,y-1,PolyHandle[i])) AND (PtInPoly(x-1,y,PolyHandle[i])) THEN BEGIN The way I draw, my spaceobjects overlap each other on wallparts, if that is not the case you should change that part into: IF (PtInPoly(x,y,PolyHandle[i]))THEN BEGIN With this change, the symbols are "accepted" on the borderline of your spaceobject. The previous one will only accept symbols at least one unit further within the object. Full script: Procedure FindSymbols; VAR i,j,k,l,EmptySpaceCounter,SymbolCounter,SpaceCounter,Z: INTEGER; temp_string,defaultRecName,defaultFieldName,DBCrit,DBCrit2,SearchString,DBString: STRING; originPt: POINT; SpaceLayer,SymbolLayer ,SubLayer,s_Z,s_Result :STRING; ObjectHandle, PolyHandle:DYNARRAY [] OF HANDLE; SpaceName: DYNARRAY [] OF STRING; SpaceXOrigin,SpaceYOrigin: DYNARRAY [] OF REAL; handleArrayCount,ArrayCounter :INTEGER; handleArrayAlloc :INTEGER; PROCEDURE GetSymbols(SymHandle:HANDLE); VAR symPt: POINT; SymbolName,recName: STRING; x,y :REAL; BEGIN FOR j:=1 TO NumRecords(SymHandle) DO BEGIN recName := GetName(GetRecord(SymHandle, j)); IF recName = defaultRecName THEN BEGIN SymbolName:=GetSymName(SymHandle); IF SymbolName <>'' THEN BEGIN GetSymLoc(SymHandle,symPt.x,symPt.y); FOR i:=1 TO handleArrayAlloc DO BEGIN x:=symPt.x-SpaceXOrigin[i]; y:=symPt.y-SpaceYOrigin[i]; IF (PtInPoly(x,y,PolyHandle[i])) AND (PtInPoly(x,y+1,PolyHandle[i])) AND (PtInPoly(x+1,y,PolyHandle[i])) AND (PtInPoly(x,y-1,PolyHandle[i])) AND (PtInPoly(x-1,y,PolyHandle[i])) THEN BEGIN { Store location } SetRField(SymHandle,recName,defaultFieldName,SpaceName[i]); {AlrtDialog(concat(SymbolName,' IS FOUND IN ',SpaceName[i],' ON : x=',symPt.x,' y=',symPt.y));} SymbolCounter:=SymbolCounter+1; END; END; END; END; END; END; Procedure GetSpace(ObjHnd:HANDLE); BEGIN { Check for Handle to excist } ObjectHandle[ArrayCounter]:=ObjHnd; { Handle Found, continue } IF ObjectHandle[ArrayCounter] <> NIL THEN BEGIN { Get space info } IF GetRfield(ObjHnd,'TDE_Space','SpaceName2') <> '' THEN BEGIN SpaceName[ArrayCounter]:=GetRfield(ObjHnd,'TDE_Space','SpaceName2'); END; IF (GetRfield(ObjHnd,'Space','Number') <> '') OR (GetRfield(ObjHnd,'Space','Name') <>'') THEN BEGIN IF (GetRfield(ObjHnd,'Space','Number') <> '') AND (GetRfield(ObjHnd,'Space','Name') <>'') THEN BEGIN SpaceName[ArrayCounter]:=concat(GetRfield(ObjHnd,'Space','Number'),': ',GetRfield(ObjHnd,'Space','Name')); END ELSE IF GetRfield(ObjHnd,'Space','Number') <> '' THEN BEGIN SpaceName[ArrayCounter]:=GetRfield(ObjHnd,'Space','Number'); END ELSE BEGIN SpaceName[ArrayCounter]:=GetRfield(ObjHnd,'Space','Name'); END; END; {AlrtDialog(concat(SpaceName[ArrayCounter],' '));} { Get the path } PolyHandle[ArrayCounter]:=GetCustomObjectPath(ObjHnd); { Get the space insertion point to correct the coordinates when comparing } GetSymLoc(ObjHnd,SpaceXOrigin[ArrayCounter], SpaceYOrigin[ArrayCounter]); IF SpaceName[ArrayCounter]='' THEN BEGIN EmptySpaceCounter:=EmptySpaceCounter+1; END ELSE BEGIN SpaceCounter:=SpaceCounter+1; END; END; ArrayCounter:=ArrayCounter+1; END; BEGIN { The record/field name of the used symbols } defaultRecName:='TDE_00 algemeen'; defaultFieldName:='RuimteNaam'; SubLayer:='elektriciteit'; { This loop will run the script for each layer, and its sub layer with symbols } FOR Z:= 0 TO +2 DO BEGIN { define the layer name for each level Z } IF Z > 0 THEN s_Z:=concat('+',Z) ELSE s_Z:=concat(Z); { add + on positive levels } SpaceLayer:=concat('niv ',s_Z,' WVB'); SymbolLayer:=concat('niv ',s_Z,' ',SubLayer); s_Result:=concat(s_Result,SpaceLayer,' with ',SymbolLayer,chr(13)); { Get all space objects } DBCrit:=concat('(PON=',chr(39),'TDE_Space',chr(39),') & (L=',chr(39),SpaceLayer,chr(39),')'); { objects } DBCrit2:=concat('(T=SYMBOL) & (L=',chr(39),SymbolLayer,chr(39),')'); { symbols } handleArrayAlloc:=COUNT(DBCrit); { we found spaceobjects in this layer AND symbols in the other, welllll let's continue } IF (handleArrayAlloc > 0) AND (COUNT(DBCrit2)>0) THEN BEGIN { Define arrays } ALLOCATE ObjectHandle [1..handleArrayAlloc]; ALLOCATE PolyHandle [1..handleArrayAlloc]; ALLOCATE SpaceName [1..handleArrayAlloc]; ALLOCATE SpaceXOrigin [1..handleArrayAlloc]; ALLOCATE SpaceYOrigin [1..handleArrayAlloc]; { Loop trough each custom space object and store handles and general info in arrays } ArrayCounter:=1; ForEachObject(GetSpace,DBCrit); { Loop trough all the symbols once, for each layer and compare them with the stored space objects of that layer } ForEachObject(GetSymbols,DBCrit2); END; { end of loop, up to the next layers one level up} END; AlrtDialog(concat('Symbols succescully named on layers:',chr(13),s_Result)); END; Run(FindSymbols); -
So how exactly are palette scripts linked to other files ? I manage to use the includes on my custom PIO's but can't get it to work on my palette scripts, the above posts ain't clear for me either using vectorworks 2010: Palette script includes $INCLUDE scripts\filename.vss scripts is a folder on the network, which has a shortcut in my main vectorworks installation folder. My code is getting cut because its too big, so I need to get this to work
-
Document Setting>Units do not update after setting change
Hippocode replied to Yoginathaswami's topic in General Discussion
Dimensions will update, but custom PIO's that have dimension parameters don't update (untill you let them recalculate of course), hhis on V2010. My college has V2011, on startup of each drawing, vectorworks fails to load the current unit settings. All my objects that load that setting fail horribly until he changes the unit to something else and back -
registered, hopefully I get acces soon.
-
I've got a 2d path custom object. Within the object, I manage to duplicate it at a distance with offsetpoly(). I'm looking for the vertexpoints of the duplicate path, but it has none. Am I facing a calculate-each-point-yourself situation or can I get/Set a second path from that duplicate ?
-
Script to list all symbols in an area
Hippocode replied to Hippocode's topic in Resource Share - Vectorscript
My guess its not easy for a beginner in vectorscript, IF you just prefer the working code without making it yourself, I'll write it for you, hence I need it myself anyway. END ELSE I'd gladly help you trough the code. END; -
Script to list all symbols in an area
Hippocode replied to Hippocode's topic in Resource Share - Vectorscript
Well, to explain it a bit further, you need a function that loops trough each layer instead of only one. With FOREACHOBJECTINLAYER, you loop trough all objects in the current layer only, so we can't use it any further. FOREACHOBJECT will loop trough all objects, with custom criteria. The same you can have a custom selection under " tools / custom selection ". There is an example in the script: line 81: this creates the critera "((PON='Space') AND (L='LayerName'))" DBCrit:=concat('(PON=',chr(39),'Space',chr(39),') & (L=',chr(39),temp_string,chr(39),')'); Line 96: ForEachObject(GetSpace,DBCrit); This will loop trough all objects with the name "Space" and the objectLayer "LayerName". In this loops, it will excecute the subprocedure GetSpace for each found object. GetSpace will store all the spaceobjects in arrays so we can use them later. GetSymbols will as it is now, loop trough all the symbols in the current layer, those will be compared with the just stored spaceobjects. There needs to be a loop before both these functions, in that loop you get different layernames, different critera, and a result for each layer. -
Indeed, Using a script that creates over 40 worksheet pages that need to be batchprinted gave me a really bad day :mad: . The silly part is that you can't import sheet layers with viewports, so even though I now have a template file with a-lot-of-viewports I still have to copy all my other drawings into this template .
-
Script to list all symbols in an area
Hippocode replied to Hippocode's topic in Resource Share - Vectorscript
yeah that's possible. Make sure that you can link the layer of the symbols with the other layer containing the space objects. If you have multiple "levels" this can be easily done by naming your layers in an easy-to-script solution The way I'd do it: Layers spaceobjects: NIV 0, NIV +1, etc Layers symbols NIV 0 elek, NIV +1 elek etc... mutual parts "0,+1,-1" I'd use a loop from -5 to +5, that assembles both layer names with the concat function. This way you can compare each objectlayer with the right symbol layer The script uses FOREACHOBJECTINLAYER to select all the symbols in the current layer, that has to be changed into selecting all the symbols in the layer with the custom name, therefor you could use FOREACHOBJECT and add criteria to select all symbols in layer X Let me know if you need any more help on this matter. -
If a parameter value of a PIO is invalid how would you alert the user?
Hippocode replied to MaxStudio's topic in Vectorscript
There are various ways of correcting this. One would be checking paramA as you did, and correcting it as it has to be "1" as minimum. if paramA <= 0 THEN SetRField(); => change paramA to 1 in the object Instead of correcting it without asking the user, you could also create a popup that it has to be atleast 1, and having that popup in a loop until the user gives a correct number. Or you could ignore the "until loop" if paramA <= 0, but if that means nothing gets drawn, you can't select the object once you deselect it.... -
Script to list all symbols in an area
Hippocode replied to Hippocode's topic in Resource Share - Vectorscript
Here you go.. I tweaked the script so it doesn't loop trough multiple layers, instead it will just use all the "space objects" and "symbols" on the current active layer. I've also added a custom record and a field that is used to store the location name. -
windows 7 and vectorworks architect 2010
Hippocode replied to michael john williams's topic in Architecture
I've got it working on windows 7 professional.