Jump to content

Sam Jones

Member
  • Posts

    1,187
  • Joined

  • Last visited

Everything posted by Sam Jones

  1. Remember there is a check box that you must check in order to rotate objects on all visible layers. If that box remains unchecked only the active layer objects will be rotated.
  2. Not near a computer right now, but first, all the objects need to be on visible layers, but only one of them has to be on the active layer. I had assumed that since the active layer is always visible the selected/is visible criteria should work I will investigate. I do not want the command to rotate objects that are not visible. I'm sure that the problem of a not set to visible active layer can be solved by adding "on active layer" as a criteria, but the actual wording of the added criteria I will have to investigate at a computer.
  3. It shouldn't make a difference, but try to be sure that one of the selected objects is on the active layer. Also send me the file and tell me what you are trying to rotate.
  4. There was a mistake in the SetUpDialog sub routine. 2 lines needed changing, but I am leaving the entire code for the command here. {Script starts here} PROCEDURE RotateObjects; {DEBUG} CONST kGroup = 11; kSymInstance = 15; {Alignment constants} kRight = 1; kBottom = 2; kLeft = 3; kColumn = 4; kResize = 0; kShift = 1; { Dialog resource ID } kOK = 1; kCancel = 2; { control IDs} kRotAngleLbl = 4; kRotAngleEditBx = 5; kRotInGrpObjsChk = 6; kRotOtherLyrsChk = 7; VAR TheObjArray :ARRAY[1..200] OF HANDLE; NumberOfObjs :INTEGER; TheActiveLayer :STRING; RotAngle :REAL; Index :INTEGER; Dialog :INTEGER; cnt :INTEGER; DlgItemNum :INTEGER; RotInsideGrps :BOOLEAN; RotOtherLayers :BOOLEAN; DlgTitle :STRING; RotQuery :STRING; InGrpsQuery :STRING; OtherLyrsQuery :STRING; OKstr :STRING; CancelStr :STRING; {==================================================================} {==================================================================} PROCEDURE SetUpDialog; BEGIN OKstr := 'OK'; {OK} CancelStr := 'Cancel'; {Cancel} DlgTitle := 'Enter Rotation Angle'; {Enter Rotation Angle} RotQuery := 'Enter angle of rotation'; OtherLyrsQuery := 'Rotate selected objects on all visible layers'; InGrpsQuery := 'Rotate objects inside groups'; Dialog := CreateLayout(DlgTitle, TRUE, OKstr, CancelStr); {create controls} CreateStaticText( Dialog, kRotAngleLbl, RotQuery, -1 ); CreateEditReal(Dialog, kRotAngleEditBx, 2, 0, 10); CreateCheckBox( Dialog, kRotInGrpObjsChk, InGrpsQuery); CreateCheckBox( Dialog, kRotOtherLyrsChk, OtherLyrsQuery); {set relations} SetFirstLayoutItem( Dialog, kRotAngleLbl ); SetBelowItem( Dialog, kRotAngleLbl, kRotAngleEditBx, 0, 0 ); SetBelowItem( Dialog, kRotAngleEditBx, kRotInGrpObjsChk, 0, 4 ); SetBelowItem( Dialog, kRotInGrpObjsChk, kRotOtherLyrsChk, 0, 1 ); END; {==================================================================} PROCEDURE HandleDialog(var dlgItem :LONGINT; data :LONGINT); VAR angValue : REAL; ok : BOOLEAN; BEGIN CASE dlgItem OF SetupDialogC: BEGIN RotInsideGrps := FALSE; SetBooleanItem(Dialog, kRotInGrpObjsChk, FALSE); RotOtherLayers := FALSE; SetBooleanItem(Dialog, kRotOtherLyrsChk, FALSE); END; kOK: BEGIN ok := GetEditReal(Dialog, kRotAngleEditBx, 2, angValue); IF ok THEN BEGIN RotAngle := angValue; GetBooleanItem(Dialog, kRotInGrpObjsChk, RotInsideGrps); GetBooleanItem(Dialog, kRotOtherLyrsChk, RotOtherLayers); END ELSE dlgItem := -1; END; END; {CASE dlgItem} END; {PROCEDURE HandleDialog} {==================================================================} PROCEDURE DoFlip(theObj:Handle); VAR locX : REAL; locY : REAL; locZ : REAL; postX : REAL; postY : REAL; grpSym : HANDLE; grpObj : HANDLE; BEGIN IF ((GetType(theObj) = 15) OR (GetType(theObj) = 86)) THEN {symbol type} BEGIN GetSymLoc(theObj,locX,locY); HRotate(theObj,locX,locY, RotAngle); (* GetSymLoc(theObj,postX,postY); HMove(theObj,locX-postX, locy-postY); *) END ELSE BEGIN HCenter(theObj,locX,locY); HRotate(theObj,locX,locY, RotAngle); END; ResetBBox(theObj); ResetObject(theObj); END; {PROCEDURE DoFlip} {==================================================================} PROCEDURE FillSelectedArray; VAR theObj : HANDLE; flipAcrossLayers : BOOLEAN; acrossLayersStr : STRING; objLayer : HANDLE; index : INTEGER; grpObj : HANDLE; theLayer : HANDLE; layerName : STRING; BEGIN FOR index := 1 TO 200 DO TheObjArray[index] := NIL; acrossLayersStr := ''; index := 0; theLayer := FLayer; layerName := GetLName(theLayer); WHILE theLayer <> NIL DO BEGIN theObj := FSObject(theLayer); {flipAcrossLayers := False;} WHILE (theObj <> NIL) DO BEGIN objLayer := theLayer; IF (GetLVis(objLayer) = 0) THEN BEGIN IF (RotOtherLayers OR (objLayer = ActLayer)) THEN BEGIN IF (RotInsideGrps & (GetType(theObj) = 11)) THEN BEGIN grpObj := FInGroup(theObj); WHILE grpObj <> NIL DO BEGIN index := index + 1; NumberOfObjs := index; TheObjArray[index] := grpObj; grpObj := NextObj(grpObj); END; END {IF GetType(theObj) = 11} ELSE BEGIN index := index + 1; NumberOfObjs := index; TheObjArray[index] := theObj; END; END {IF (flipAcrossLayers OR (objLayer = ActLayer))} END; {IF (GetLVis(objLayer) = 0)} theObj := NextSObj(theObj); END; {WHILE (theObj <> NIL)} theLayer := NextLayer(theLayer); END; {WHILE theLayer <> NIL} END; {PROCEDURE FillSelectedArray} {==================================================================} BEGIN SetUpDialog; DlgItemNum := RunLayoutDialog(Dialog,HandleDialog); IF DlgItemNum = 1 THEN BEGIN TheActiveLayer := GetLName(ActLayer); FillSelectedArray; DSelectObj(((L<>TheActiveLayer))); DSelectAll; FOR Index := 1 TO NumberOfObjs DO DoFlip(TheObjArray[Index]); FOR Index := 1 TO NumberOfObjs DO BEGIN SetSelect(TheObjArray[Index]); ResetObject(TheObjArray[Index]); END; END; {IF (NOT DidCancel)} ClrMessage; END; RUN(RotateObjects); {Script ends here}
  5. I just tested it, and It works in both 2019 and 2020. But... there seems to be a bug that lets it only work on objects on the Active Layer. I will investigate. It should work across layers, but for now only the active layer.
  6. These 2 scripts are part of the AutoPlot Tools for Spotlight, but I will share them here. First, "Rotate Left 90" This will rotate each selected object around its insertion point 90 degrees left. If the object does not have an insertion point it will rotate them around the geographic center. You can change the "90" in the script to any angle you desire. {Script starts here} PROCEDURE RotateEachLeft90; VAR NumberOfObjs : INTEGER; PROCEDURE RotateObj(theObj : HANDLE); VAR locX : REAL; locY : REAL; BEGIN NumberOfObjs := NumberOfObjs + 1; IF ((GetType(theObj) = 15) OR (GetType(theObj) = 86)) THEN GetSymLoc(theObj,locX,locY) ELSE HCenter(theObj,locX,locY); HRotate(theObj, locX, locY, 90); END; {PROCEDURE FillSelectedArray} {==================================================================} BEGIN NumberOfObjs := 0; ForEachObject(RotateObj, ((VSEL=TRUE))); ClrMessage; END; RUN(RotateEachLeft90); {Script ends here} Second, "Rotate by Query" This command will ask you what angle you wish to rotate to, whether or not you want to include other layers or enter groups one level. {Script starts here} PROCEDURE RotateObjects; {DEBUG} CONST kGroup = 11; kSymInstance = 15; {Alignment constants} kRight = 1; kBottom = 2; kLeft = 3; kColumn = 4; kResize = 0; kShift = 1; { Dialog resource ID } kOK = 1; kCancel = 2; { control IDs} kRotAngleLbl = 4; kRotAngleEditBx = 5; kRotInGrpObjsChk = 6; kRotOtherLyrsChk = 7; VAR TheObjArray :ARRAY[1..200] OF HANDLE; NumberOfObjs :INTEGER; TheActiveLayer :STRING; RotAngle :REAL; Index :INTEGER; Dialog :INTEGER; cnt :INTEGER; DlgItemNum :INTEGER; RotInsideGrps :BOOLEAN; RotOtherLayers :BOOLEAN; DlgTitle :STRING; RotQuery :STRING; InGrpsQuery :STRING; OtherLyrsQuery :STRING; OKstr :STRING; CancelStr :STRING; {==================================================================} {==================================================================} PROCEDURE SetUpDialog; BEGIN OKstr := 'OK'; {OK} CancelStr := 'Cancel'; {Cancel} DlgTitle := 'Enter Rotation Angle'; {Enter Rotation Angle} RotQuery := 'Enter angle of rotation'; OtherLyrsQuery := 'Rotate selected objects on all visible layers'; InGrpsQuery := 'Rotate objects inside groups'; Dialog := CreateLayout(DlgTitle, TRUE, OKstr, CancelStr); {create controls} CreateStaticText( Dialog, kRotAngleLbl, RotQuery, -1 ); CreateEditReal(Dialog, kRotAngleEditBx, 2, 0, 10); CreateCheckBox( Dialog, kRotInGrpObjsChk, OtherLyrsQuery); CreateCheckBox( Dialog, kRotOtherLyrsChk, InGrpsQuery); {set relations} SetFirstLayoutItem( Dialog, kRotAngleLbl ); SetBelowItem( Dialog, kRotAngleLbl, kRotAngleEditBx, 0, 0 ); SetBelowItem( Dialog, kRotAngleEditBx, kRotInGrpObjsChk, 0, 4 ); SetBelowItem( Dialog, kRotInGrpObjsChk, kRotOtherLyrsChk, 0, 1 ); END; {==================================================================} PROCEDURE HandleDialog(var dlgItem :LONGINT; data :LONGINT); VAR angValue : REAL; ok : BOOLEAN; BEGIN CASE dlgItem OF SetupDialogC: BEGIN RotInsideGrps := FALSE; SetBooleanItem(Dialog, kRotInGrpObjsChk, FALSE); RotOtherLayers := FALSE; SetBooleanItem(Dialog, kRotOtherLyrsChk, FALSE); END; kOK: BEGIN ok := GetEditReal(Dialog, kRotAngleEditBx, 2, angValue); IF ok THEN BEGIN RotAngle := angValue; GetBooleanItem(Dialog, kRotInGrpObjsChk, RotInsideGrps); GetBooleanItem(Dialog, kRotOtherLyrsChk, RotOtherLayers); END ELSE dlgItem := -1; END; END; {CASE dlgItem} END; {PROCEDURE HandleDialog} {==================================================================} PROCEDURE DoFlip(theObj:Handle); VAR locX : REAL; locY : REAL; locZ : REAL; postX : REAL; postY : REAL; grpSym : HANDLE; grpObj : HANDLE; BEGIN IF ((GetType(theObj) = 15) OR (GetType(theObj) = 86)) THEN {symbol type} BEGIN GetSymLoc(theObj,locX,locY); HRotate(theObj,locX,locY, RotAngle); GetSymLoc(theObj,postX,postY); HMove(theObj,locX-postX, locy-postY); END ELSE BEGIN HCenter(theObj,locX,locY); HRotate(theObj,locX,locY, RotAngle); END; ResetBBox(theObj); ResetObject(theObj); END; {PROCEDURE DoFlip} {==================================================================} PROCEDURE FillSelectedArray; VAR theObj : HANDLE; flipAcrossLayers : BOOLEAN; acrossLayersStr : STRING; objLayer : HANDLE; index : INTEGER; grpObj : HANDLE; theLayer : HANDLE; BEGIN FOR index := 1 TO 200 DO TheObjArray[index] := NIL; acrossLayersStr := ''; index := 0; theLayer := FLayer; WHILE theLayer <> NIL DO BEGIN theObj := FSObject(theLayer); flipAcrossLayers := False; WHILE (theObj <> NIL) DO BEGIN objLayer := theLayer; IF (GetLVis(objLayer) = 0) THEN BEGIN IF (RotOtherLayers OR (objLayer = ActLayer)) THEN BEGIN IF (RotInsideGrps & (GetType(theObj) = 11)) THEN BEGIN grpObj := FInGroup(theObj); WHILE grpObj <> NIL DO BEGIN index := index + 1; NumberOfObjs := index; TheObjArray[index] := grpObj; grpObj := NextObj(grpObj); END; END {IF GetType(theObj) = 11} ELSE BEGIN index := index + 1; NumberOfObjs := index; TheObjArray[index] := theObj; END; END {IF (flipAcrossLayers OR (objLayer = ActLayer))} END; {IF (GetLVis(objLayer) = 0)} theObj := NextSObj(theObj); END; {WHILE (theObj <> NIL)} theLayer := NextLayer(theLayer); END; {WHILE theLayer <> NIL} END; {PROCEDURE FillSelectedArray} {==================================================================} BEGIN SetUpDialog; DlgItemNum := RunLayoutDialog(Dialog,HandleDialog); IF DlgItemNum = 1 THEN BEGIN TheActiveLayer := GetLName(ActLayer); FillSelectedArray; DSelectObj(((L<>TheActiveLayer))); DSelectAll; FOR Index := 1 TO NumberOfObjs DO DoFlip(TheObjArray[Index]); FOR Index := 1 TO NumberOfObjs DO BEGIN SetSelect(TheObjArray[Index]); ResetObject(TheObjArray[Index]); END; END; {IF (NOT DidCancel)} ClrMessage; END; RUN(RotateObjects); {Script ends here}
  7. I got it to work fine on my mac, not in dark mode, so I have no clue as to how to help. BTW, I never thought of turning a cable into a red symbol; cool idea.
  8. Have you looked into the financial footprint of AutoPlot Tools?
  9. You are not the only one who would be interested. For a while now. the German distributor has been adding wonderful tools that never seem to make it back to the mothership. They have a wonderful class editing system that it would be nice to have in the English version. The Datenbank abgleichen (Compare database) would be a fabulous addition for all industries. I have just put in a feature request for it to be added to the English version. Go to the feature request and vote for it.
  10. There is a very cool thing in VWX 2020 German version, called Datenbank abgleichen (Compare database). Very useful tool. Make possible to connect Excel Worksheet and compare Excel and VWX Databases, when you can choose which one to update. This would be such a wonderful addition for all industries. This should be a mandatory acquisition for the English and all other versions. It is hard to imagine why it has not happened. '
  11. Success! Your investigations into the SDK have made you the holder of arcane knowledge and a true guru.
  12. The format for a break out is: cable type > number of circuits x connector type. I think the Multicable VW checks to make sure the cable type in the break out matches the cable type selected. Is L2130 a type of cable? Did you put it in the CableType parameter list?
  13. Despite missing some of the good feedback, I never run in developer mode, and I always retrieve the index. However, I have always put the indents in Widget Prep. I am looking forward to making the moving them to the Init Event. Thank You !!
  14. You have to use the "Plug-in Manager" When the Plug-in Manager opens click on the left most tab, "Built-in Plug-ins". Then scroll down the list and select "Multicable VW" The click on the "Customize" button below the list. Once the "Customize" dialog opens, click on the "Parameters" tab on the top, and then scroll down the list and select the "Break Out Type" parameter. Once the Break Out Type parameter is selected click on the Edit button below the list. When the "Edit Parameter" dialog opens, click on the "Choices" button. When the "Edit Choices" dialog opens you will be presented with a list, and you can type in your break out choice any where in the list. That choice must be one line with nothing els on the line. You will need to do the same thing with the "CableType" parameter. Now for the scary part. Mistakes in this process can break the tool.
  15. I can't be of much help, because I don't know the application. Some questions. Drawing a feeder cable to a bistro would be straight forward. What do you want coming out of the distro? Is a Soca 7 a multi cable powering multiple motors? Does it have a break out? Is it a multi function cable powering a single motor? Excuse my ignorance.
  16. I always seem to be one conversation exchange behind. Using any other method than ODBC for a live data connection to Excel or any other app would require the active participation of the other app, its company and engineers. John McKernon is a lighting designer who desperately wanted to eliminate the import and export of data that was then required to communicate between LW and VW. VW wanted to solidify its hegemony over entertainment production drawings, so LW and VW actively cooperated in developing the link. I know you have invested a lot of time in developing your Excel templates, but if you want a live connection, use Lightwright. It has a surprising array of formatting capabilities. I expect that won't happen, so you are left with importing and exporting and putting in a feature request for VW to implement a feature like AutoCAD's Data Link. That would be a useful feature for all the industries that use VW. Before I got too excited about AutoCAD's Data Link feature, I would like to see it work with a real set of data, but there is no denying it is intriguing.
  17. The worksheet resides with VW so VW knows what the connection is. Excel does not know and does not care. AFAIK, the only way Excel can can exchange data with another file created and edited by another app is using ODBC. That even includes with its own in house apps like WORD. If ODBC is not being used then I think Excel would need to make a special effort to communicate with an app that didn't use ODBC. As a result, the AutoCAD link is interesting. I am guessing that they have simplified the user interface (UI) for creating the ODBC link. It would be nice to know how they get handles to the Excel part of the set up. It is all very curious and a bit intriguing. If AutoCAD uses a method other than ODBC that would also be intriguing. However, since AutoCAD has almost no tools for creating entertainment lighting, rigging, and sound drawings, I will never invest the time to investigate.
  18. As to my opinion about the LW/VW link, it is great. It needs to be turned on in each file. From then on, each app knows it needs to read the XML for updates, and each app knows what the agreed upon XML structure is. LW does data consistency checks and will instruct you on what to do if something is wonky. I'm sure the method could be used with other apps, but it requires that both apps implement the switch to turn it on and know where to look for the XML file and what its structure is. This is not something that could be implemented by VW alone. At least not the way it is implemented with LW. Do you think Microsoft would be willing to do something special with VW?
  19. Data Visualization is a super duper feature. Allowing the visualization of different data attached to the same object. This allows for different sheets to be prepared for different purposes and crews. I think it will be well worth the time invested to get it to work for you.
  20. You're very welcome, and it is why the list is here. Don't be shy
  21. You might be able to help. Perhaps your diagnosis and solution can point in a direction for me to look.
  22. It happens with every document, old or new, template or not, the first time it is opened on the first time a PIO instance is created or selected.
  23. If you had a worksheet like the one below, I'm not sure why collaborating or last minute changes would make editing fields any more difficult than editing in the OIP?
  24. You will only be able to edit symbols that have been downloaded to the file you are working in, but you save that file and any symbol definitions you have edited. Then right click on the symbol definition and edit the 2D and/or the 3D portions.
×
×
  • Create New...