Jump to content

Julian Carr

  • Content Count

  • Joined

  • Last visited

Everything posted by Julian Carr

  1. Then you have to consider how the symbols are constructed. Are there container objects within that you need to traverse such as Groups, or PIOs that are controlling fill attributes of objects within independently? Then you will also need to check whether any of the objects have their attributes being controlled by class and respond accordingly. So all in all, not a simple task.
  2. Don't think so. It could make drawing navigation very slow.
  3. I think this works: FlagTopPlan := GetProjection(ActLayer) = 6;
  4. Glad you got it working. Apart from copying and pasting between files, this functionality also ensures that the symbol is seen as being in-use by the Purge command, so won't get accidentally deleted.
  5. You need to add a symbol instance to the profile group of the PIO using SetCustomObjectProfileGroup(). Because this is persistent between regens, you need to delete the profile group on each regen then reinstate it. Something like this: Symbol('mysymbol', 0, 0, 0); h1 := LNewObject; h2 := GetCustomObjectProfileGroup(ghParm); IF h2 <> Nil THEN DelObject(h2); IF h1 = NIL THEN Flag := SetCustomObjectProfileGroup(ghParm, h2) You can always check the existence of the profile group by selecting your object then using the Edit Group command.
  6. Sorry you will need to put a minus in front of Name2Index, but also note that you may not see the line is dashed because the line from the adjoining component is solid, so you might need to do something like this: procedure test; var Response : boolean; begin Response := DeleteAllComponents (nil); Response := InsertNewComponentN (nil, 1, 5, 0, 10, 0, 0, 2); Response := InsertNewComponentN (nil, 2, 20, 0, 6, 10, -Name2Index('Dash Style-2'), 0); SetTool (13); end; Run (test);
  7. Try using Name2Index('Dash Style-2') in place of -2, as the number will vary depending on the order the dash styles were imported into the drawing. Obviously the dash style will already need to exist in the file for this to work.
  8. So what Josh is referring to is a structure like this, which is one of the most time saving scripts you can have because it can be adapted to do so many things:: Procedure TimeSaver; Procedure DoIt(h1 : HANDLE); BEGIN SetClass( h1, ‘Class Name’ ); END; BEGIN ForEachObject(DoIt, (Sel = True)); END; Run(TimeSaver);
  9. The Date() procedure has always used the system settings to determine what is displayed. On the odd machine it ignores the system settings, but this is very rare.
  10. Never mind, I got it working. Not really sure what I did however, but now it works.
  11. Is anyone using vsoStateGetParamChng() with n event enabled linear PIO? It works OK with a point object, but returns false for a linear object. Thanks.
  12. You might be able to do it in the reset evert (3) using this: Flag := vsoStateGetParamChng(ghParm, gOutWidgID, gn, gsOldParmValue); gOutWidgID is the widget ID of the param that has changed. gsOldParmValue is the previous parameter value. I've never used it with control points though, so good luck.
  13. Thanks Orso. Next question. How to get the tile fill name of a wall component. If I use GetComponentFill() then index2name() on the returned fill, it doesn't work. Thanks.
  14. Anyone have a code snippet for applying a Tile resource to a polygon? Not having much luck. TIA.
  15. Anyone have a code snippet for applying a Tile resource to a polygon? Not having much luck. TIA.
  16. Thank Josh. Yeah I tried that already but unfortunately it doesn't do anything in this case and the function returns false.
  17. Actually, one more. Any ideas for an equivalent to InsertSymbolInFolder() for shifting imported resources to a designated resource folder? InsertSymbolInFolderN() seems to be accepted by the compiler, but doesn't do anything and is not in the Function Ref.
  18. Has anyone figured out how to create a resource folder (other than a symbol folder [type 92]), and if so, what are the Object Type numbers for the various types of resource folders? [Edit]: Actually all resource folders are type 92, and I have tried using SetParent(), but that doesn't work to put resources into resource folders. Thanks!
  19. Hi Markus, I don't know about your command but I do use DeselectAll in a lot of scripts and it continues to work there. Do you know you can also deselect all by holding the Spacebar down then double tapping the X key? The Spacebar preserves the current tool selection. If you don't need this, then just double tapping X will suffice. Julian
  20. OK thanks for the confirmation Nicolas. Interesting that Vw can write to the Libraries folder though. I guess that's a slightly different mechanism though.
  21. Thanks guys. Nicolas: I am the admin user on both machines and if it works on a Mac then, should it not work on a PC? Still, maybe you are right. Pat: Message(GetFolderPath(-1)); also returns the path to application folder on Mac and PC. Sam: If you run Message(GetFolderPath(1)); you will see it does return a separator at the end of the path name.
  22. Anyone know why this code: Procedure T; VAR s1 : STRING; BEGIN s1 := Concat(GetFolderPath(1), 'Test.txt'); ReWrite(s1); WriteLn('test'); Close(s1); END; Run(T); works fine on a Mac but returns this error on a PC: Error on line=6: T S1 - File operation returned error. Error on line=8: T S1 - Bad file name. C:\Program Files\Vectorworks 2018\Test.txt Thanks!
  23. Thanks Nicolas. Yes I tried a few different combinations including this: {$INCLUDE MessageScriptTesting/MessageScript.vss} but none of them worked.
  24. Thanks again Nicolas. Unfortunately I can't get it to work. A full path such as this will work: {$INCLUDE /Users/juliancarr3/Desktop/MessageScriptTesting/MessageScript.vss } but then something like this (or variations thereof), does not work: {$INCLUDE /MessageScriptTesting/MessageScript.vss } The Vectorworks file with the saved views is also in the MessageScriptTesting folder. The following also doesn't work on the Mac which is unusual because I normally use backslashes in include names: {$INCLUDE \Users\juliancarr3\Desktop\MessageScriptTesting\MessageScript.vss }


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.

  • Create New...