Jump to content

Hello Community!

This Saturday, April 11, from 9am – 1pm EDT we will be performing maintenance on the Vectorworks Community Board. During this time, the site will be unavailable.

Julian Carr

Distributor
  • Content Count

    204
  • Joined

  • Last visited

Everything posted by Julian Carr

  1. Untested, but something like this should work... Procedure CheckSymbolExists; VAR gsSymNameCurrent : STRING; Function DoIt(h1 : HANDLE) : BOOLEAN; VAR sSymNameExist : STRING; BEGIN IF (h1 <> Nil) & (GetType(h1) = 16) THEN BEGIN sSymNameExist := GetSDName(h1); IF sSymNameExist = gsSymNameCurrent THEN SysBeep; END; END; BEGIN gsSymNameCurrent := StrDialog('Symbol name to search for:', ''); ForEachObjectInList(DoIt, 0, 2, FSymDef); END; Run(CheckSymbolExists);
  2. It sometimes behaves like this Pat but I just tolerate the quirkiness and restart VW, Edit/Exit the WS Editor, etc. until it works. Typical of VS though. You steam along making great progress then something like this of another odd result stops you in your tracks.
  3. Draw a rectangle on any sheet layer, that is just a bit bigger than the page size. Give it a unique name like 'Custom-Select-Rect'. Run the script below and substitute your PIO name for My PIO Name. ForEachObject(SetSelect, ((LOC='Custom-Select-Rect') & (PON='My PIO Name'))); This will select the objects on ALL sheet layers.
  4. Yes once a PIO is event enabled, then everything must be dealt with in the correct event. I'm pretty sure there are some sample event based PIOs floating around or in the SDK.
  5. The duplicates are likely being placed relative to the internal origin.. Try making sure the symbols are being inserted in Event = 3. Otherwise they can be outside the PIO container.
  6. I think you would need to use GetSymbolOptionsN() then SetSymbolOptionsN(), loading the latter with the values from the former, except for the symbol name.
  7. A1. Layer stacking order. A2. Don't know.
  8. Try this slight variation (untested): Procedure SomeCalloutMrgnDialog; Var H1:Handle; B1:Boolean; MrgnCall, MrgnValue,LyrScale:Real; MrgnValueStrng,default,request:String; Procedure GetValues; Begin request:='CallOut PIO Page Unit Margin'; default:='0.0625'; MrgnCall:=DistDialog(request,default); LyrScale:=GetLScale(ActLayer); MrgnValue:=LyrScale*MrgnCall; MrgnValueStrng:=Concat(MrgnValue); End; Procedure SetObj_Value(H1:Handle); Begin SetRField(H1,'Callout','Margin',MrgnValueStrng); ResetObject(H1); SetDSelect(H1); End; Begin GetValues; ForEachObject(SetObj_Value,(((VSEL=TRUE) & (PON='Callout')))); DoMenuTextByName('Previous Selection',0); End; Run(SomeCalloutMrgnDialog);
  9. Sorry, I meant to say this is where it needs to be if you are using collapsing widget separators. Otherwise, it can be used in different places.
  10. I'm not seeing any issues either, but it might depend on where in the code you are calling it. Should be in kObjOnInitXProperties (event 5).
  11. CreateLineWeightPopup() doesn't give the option to use class thickness Andy.
  12. Try GetLineWeightChoice() Andy. At least that's what I use.
  13. Set the above script to be Vectorscript, not Python. If you can't do that, in python it will be something like this: vs.SetClassN(vs.FSActLayer(), 'my class name', True) but I know nothing about python.
  14. You could try this: SetClassN(FSActLayer, 'my class name', True); I likely won't work in groups or symbols though. If used on a group (not in a group), the last argument (true or false) will determine if all the objects in the group also get the class assignment.
  15. You need to use SelectChoice(). The index is zero based so make sure you load the menu from zero.
  16. Wild guess. Try adding this: ResetObject(CounterTopH); at the end of the create floor section.
  17. Try changing the criteria in ForEachObject() to: (INSYMBOL & INOBJECT & INVIEWPORT & (T=DIMENSION) & (SEL=TRUE))
  18. Actually I did know Pat and have used it in a worksheet previously. I just forgot. It's there in the insert function list.
  19. I agree Pat. Some invisible characters in the code I suspect.
  20. This script works for me. Pat's one doesn't. You have to call the script name not the procedure name however, in RunScript(). Procedure T; BEGIN WSScript_SetResStr(GetPluginStyle(WSScript_GetObject)); END; Run(T);
  21. It's possible you have picked up an invisible character by copying from the browser. Try deleting the last line and everything below it then retyping it manually. Or copy the script to a text editor and turn on invisible characters to see if you can spot something.
  22. It works for me. What is the error?
  23. You can do this using the single most powerful procedure in VS: ForEachObject. It also filters out other object so will only affect dimensions in this case. PROCEDURE DimTypical; PROCEDURE DoIt(h1 : HANDLE); BEGIN SetObjectVariableString(h1, 10, ' Typ.'); ResetObject(h1); END; BEGIN ForEachObject(DoIt, (T=DIMENSION) & Sel); END; Run(DimTypical);
  24. Yep ResetObject(Selection); will do it. Also note there is a missing semi colon on line 6.
  25. It works for me Sam and definitely needs to be in the kObjOnInitXProperties event (5). It's possible it also needs this: CONST kObjXPropAcceptStates = 18; gFlag := SetObjPropVS(kObjXPropAcceptStates, TRUE); Also have you tried quitting and restarting Vw? I find this necessary sometimes even in developer mode.

 

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...