Jump to content

Sam Jones

Member
  • Content count

    218
  • Joined

  • Last visited

Community Reputation

22 Great

5 Followers

About Sam Jones

  • Rank
    Journeyman

Personal Information

  • Occupation
    Technical Director
  • Homepage
    www.autoplotvw.com
  • Location
    Los Angeles

Contact Info

  • Skype
    AutoPlotVW

Recent Profile Visitors

1,165 profile views
  1. Sam Jones

    Hide fixture label legend by fixture type?

    Ah, I thought removing the attributes would leave a white space. This is very cool. Kind of a way for an object to have multiple class graphic attributes based on record values'
  2. Sam Jones

    Hide fixture label legend by fixture type?

    How were you able to hide anything? I thought all you could do was change fill and line attributes based on record values?
  3. Sam Jones

    Setting Z height at PIO creation

    Thanks for the thought, but I just tried it. Doesn't work
  4. Sam Jones

    Setting Z height at PIO creation

    So the question becomes when/how do I do this: set the height at 36(or some other default) upon insertion, and then let the user set the z height. BEGIN GetVersion(Major,Minor,Maintenance,Platform); GetUnits(Fraction,Display,Format,UPI,UnitName,SquareName); Result := GetCustomObjectInfo(PIOName,PIOHan,PIORec,WallHdl); vsoGetEventInfo(EventMessage, MsgData); OK := GetLocalizedPlugInName(PIOName,LocalPIOName); BarW := PBWidth * -1; BarL := PBLength; BarT := PBThick; NewBar := IsNewCustomObject('Load Bar'); CASE EventMessage OF kResetEventID: {3} BEGIN ParamChangeFlag := (vsoStateGetParamChng(PIOHan,ParamChangeWidget,ParamChangeIndex,OldParam)); IF (ParamChangeFlag=True) THEN BEGIN END; {IF (ParamChangeFlag=True) } ParamChangeTrig := FALSE; PIOChangeTrig := FALSE; Rect(0, 0, BarL, BarW); BeginXTrd(0,BarT); Rect(0, 0, BarL, BarW); EndXtrd; IF IsNewCustomObject('Load Bar') THEN Move3DObj(PIOHan, 0, 0, 36); vsoStateClear(PIOHan ); END; kObjOnAddState: {44} BEGIN GetStateChange; END; kObjOnInitXProperties: {5} BEGIN Result := SetObjPropVS (kObjXPropHasUIOverride,True); Result := SetObjPropVS(12, TRUE); {kObjXHasCustomWidgetVisibilities} SetPrefInt(590, 1 ); {kParametricEnableStateEventing} Result := SetObjPropVS (18,TRUE); {kObjXPropAcceptStates} Result := vsoInsertAllParams; Result := SetObjPropVS(kObjXPropDataNameDisabled, TRUE);{kObjXPropDataNameDisabled} SetPrefInt (590,1); {varParametricEnableStateEventing,ResetStatesEvent} END; kObjOnWidgetPrep: {41} BEGIN WidgetPrep; END; {kObjOnWidgetPrep} kObjOnObjectUIButtonHit: BEGIN CASE MsgData OF kRefreshBtnID: BEGIN END; END; END; {kObjOnObjectUIButtonHit} END; {case} SetRField(PIOHan,PIOName, 'IsNewBar', 'FALSE'); END; RUN(TruckLoadBar);
  5. Sam Jones

    Setting Z height at PIO creation

    Since the Move3DObj(PIOHan, 0, 0, 36); works just fine without the IsNew flag test, I would think that I don't need to explicitly set the object to hybrid. So, I could keep resetting the flag, but then how do allow the user to set the Z height later? S
  6. Sam Jones

    Setting Z height at PIO creation

    No. The first time the PIO is placed, even without running in developer mode, it seems that the flag is cleared. It ...seems... that the reset event is run more than once, the flag is cleared and after the final exit from the PIO code the object is drawn at z = 0 height. If I don't do an "IsNewCustomObject" test or a custom one with a custom flag, the object is drawn at the desired 36 drawing units. But, without such a flag, every time an edit is made to OIP 36 is added to the current z height, and the object climbs.
  7. Sam Jones

    Setting Z height at PIO creation

    Well, Move3DObj(PIOHan, 0, 0, 36); works if I call it right after EndXtrd, but every time I change a value in the OIP after creation 36 is added to the Z value of the PIO and it starts climbing to the moon. I tried to put an IsNew test like this Rect(0, 0, BarL, BarW);   BeginXTrd(0,BarT);   Rect(0, 0, BarL, BarW * -1);   EndXtrd; IF IsNewCustomObject('Load Bar') THEN Move3DObj(PIOHan, 0, 0, 36); But the IsNewCustomObject flag always seems to get cleared before last reset event. I tried to make my own flag as a parameter set to TRUE as a default and then cleared after drawing, but that doesn't work. I don't mind positing the whole thing; it's simple and short. I can't figure it out.
  8. Sam Jones

    Setting Z height at PIO creation

    "IsNew" is evaluating as expected, since the alert does occur. It has a 3D component, because it is a hybrid object Rect(0, 0, BarL, BarW);  BeginXTrd(0,BarT);  Rect(0, 0, BarL, BarW * -1);  EndXtrd; Move3DObj() fails. If it supposes to work, maybe it is in the wrong place {??}.
  9. Sam Jones

    Setting Z height at PIO creation

    Unfortunately neither asdfasdf or asdfasdf work in the Reset Event Rect(0, 0, BarL, BarW); BeginXTrd(0,BarT); Rect(0, 0, BarL, BarW * -1); EndXtrd; IF IsNew THEN BEGIN AlrtDialog('This is a new bar'); Move3DObj(PIOHan, 0, 0, 36); (* Move3D(0, 0, 36); *) END; I want to set the Z height of the newly created hybrid PIO.
  10. Sam Jones

    Setting Z height at PIO creation

    I have a hybrid PIO whose z height I want to set at creation. The following code in the Reset Event does not work. Rect(0, 0, BarL, BarW); BeginXTrd(0,BarT); Rect(0, 0, BarL, BarW); EndXtrd; IF IsNew THEN SetHeight(PIOHan, 36*UPI); I want to set a height at creation, but allow the user to adjust the Z height after creation. ??? TIA
  11. Sam Jones

    Page Setup (Size) for Sheet Layers

    I thought I sent a note late last night. I found the problem; I was using the wrong index in LDrawSize[ ] variable. Never code after dinner, if wine is served.
  12. Sam Jones

    Page Setup (Size) for Sheet Layers

    Then I don't know what's happening. The script below writes 8.5 x 11 dimensions for all the sheet layers. Those sheet layers have different page setups between 8.5 x 11 and 36 x 48. PROCEDURE WriteLayerStructure; {DEBUG} TYPE DrawSizeInfo = STRUCTURE x1 : REAL; y1 : REAL; x2 : REAL; y2 : REAL; END; VAR CurrFileName : STRING; LayerNum : INTEGER; LayerArray : ARRAY[1..100] OF STRING; LyrDescrArray : ARRAY[1..100] OF STRING; ScaleArray : ARRAY[1..100] OF REAL; LTypeArray : ARRAY[1..100] OF INTEGER; LDrawSize : ARRAY[1..100] OF DrawSizeInfo; {==============================================================} PROCEDURE CollectLayerInfo; VAR theLayer : HANDLE; layerName : STRING; layerDescrip : STRING; theScale : REAL; theType : INTEGER; lyrNum : REAL; x1, y1, x2, y2 : REAL; BEGIN layerNum := 1; theLayer := FLayer; layerName := GetLName(theLayer); IF layerName = '0' THEN layerName := '000'; theScale := GetLScale(theLayer); theType := GetObjectVariableInt(theLayer,154); layerDescrip := 'zz'; IF theType = 2 THEN layerDescrip := GetObjectVariableString(theLayer,159); IF (layerDescrip = '') THEN layerDescrip := 'zz'; GetDrawingSizeRectN(theLayer, x1, y1, x2, y2); LayerArray[layerNum] := layerName; LyrDescrArray[layerNum] := layerDescrip; ScaleArray[layerNum] := theScale; LTypeArray[layerNum] := theType; LDrawSize[layerNum].x1 := x1; LDrawSize[layerNum].y1 := y1; LDrawSize[layerNum].x2 := x2; LDrawSize[layerNum].y2 := y2; theLayer := NextLayer(theLayer); WHILE theLayer <> NIL DO BEGIN layerNum := layerNum + 1; layerName := GetLName(theLayer); IF ValidNumStr(layerName,lyrNum) THEN layerName := CONCAT('zz',layerName); theScale := GetLScale(theLayer); theType := GetObjectVariableInt(theLayer,154); {layerDescrip := GetObjectVariableSTRING(theLayer,159);} IF theType = 2 THEN layerDescrip := GetObjectVariableString(theLayer,159); IF (layerDescrip = '') THEN layerDescrip := ' '; GetDrawingSizeRectN(theLayer, x1, y1, x2, y2); LayerArray[layerNum] := layerName; LyrDescrArray[layerNum] := layerDescrip; ScaleArray[layerNum] := theScale; LTypeArray[layerNum] := theType; LDrawSize[layerNum].x1 := x1; LDrawSize[layerNum].y1 := y1; LDrawSize[layerNum].x2 := x2; LDrawSize[layerNum].y2 := y2; theLayer := NextLayer(theLayer); END; {WHILE theLayer <> NIL} END; {PROCEDURE CollectLayerInfo} {==============================================================} BEGIN CurrFileName := GetFName; CurrFileName := CONCAT(CurrFileName,' ','Layer List'); CollectLayerInfo; PutFile('Name and Save the Layer List File',CurrFileName,FileName); IF NOT DidCancel THEN BEGIN WriteLn(LayerNum); FOR Index := 1 TO LayerNum DO BEGIN WriteLn(LayerArray[Index]); WriteLn(LyrDescrArray[Index]); WriteLn(ScaleArray[Index]); WriteLn(LTypeArray[Index]); WriteLn(LDrawSize[layerNum].x1); WriteLn(LDrawSize[layerNum].y1); WriteLn(LDrawSize[layerNum].x2); WriteLn(LDrawSize[layerNum].y2); END; {FOR Index := 1 TO LayerNum} CLOSE(FileName); END; {IF NOT DidCancel} AlrtDialog('Done Writing Layer List'); END; RUN(WriteLayerStructure);
  13. Sam Jones

    Page Setup (Size) for Sheet Layers

    Also, I would assume that GetDrawingSizeRectN would use the same units. As long as I want the same units, would I need to care what they are?
  14. Sam Jones

    Page Setup (Size) for Sheet Layers

    ScaleFactor ??? Needed for ???
  15. Sam Jones

    Page Setup (Size) for Sheet Layers

    Just for background. I am writing 2 scripts: "WriteLayerStructure" and "GetLayerStructure". The object is to write layer to a file and to read it back into another file. Everything works great, except sheet layers don't get their page set up written and read. I don't care about design layers. Don't bother bringing up templates. The scripts are used to bring a layer structure into drawings sent to me by other people. Actually, the script is for others who are anxiously waiting. Thanks, S

 

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