Jump to content

JBenghiat

Member
  • Posts

    2,004
  • Joined

  • Last visited

Everything posted by JBenghiat

  1. You need to apply a texture to the object with a glow reflectivity. You can create a new Renderworks Texture in the Resource Manager, and then edit it. Under Reflectivity, select Glow. In the Glow options, enable Emit light. Apply the texture in the Render tab of Object Info, by dragging the texture to the object, or using the Texture Tool. You do not need any additional lights for the glow, but you do need to be in wither Renderworks or Redshift, and you need your Lighting Options set to at least one bounce.
  2. Yes, this is known/expected. Vectorworks preserves the Python session and caches any imports. There’s been a couple threads on the subject:
  3. Double and real are synonymous. They both map to reals. Sint32 is a signed 32 bit integer. It maps to LONGINT. void is nothing, so there is no return. Using the standard SetOV call will probably work, ignoring the second argument. RefNumber is another LONGINT. It should work with Index2Name. I’m not sure what TransformationMatrix would return, if it works. In C, it’s an object that holds the transformation matrix as arrays. Calls marked “public for vs” just means that they duplicate a function elsewhere, but the only way you can access through VS is via an object variable. I think any call will work, it just may or may not return usable data.
  4. I think you'll have better luck using the object variables rather than looking at the cache group: // Viewport type selectors // -------------- const short ovViewportProjectionType = 1000; // short read/write - the viewport projection type. - Public for VS const short ovViewportRenderType = 1001; // short read/write - the viewport render type. - Public for VS const short ovViewportPerspectiveDistance = 1002; // real read/write - the viewport perspective distance (used with custom perspective). - Public for VS const short ovViewportScale = 1003; // real read/write - the viewport scale. - Public for VS const short ovViewportDirty = 1004; // Boolean read/write - the viewport out-of-date (dirty) state. - Public for VS const short ovViewportProject2D = 1005; // Boolean read/write - the viewport project 2D state. - Public for VS const short ovViewportRenderBackground = 1006; // Sint32 read/write - the viewport render background. - Public for VS const short ovViewportViewType = 1007; // short read/write - the viewport view type. - Public for VS const short ovViewportLineWeightScale = 1008; // double read/write - the viewport line weight scale. - Public for VS const short ovViewportArrowheadScale = 1009; // double read/write - the viewport arrowhead scale. - Public for VS const short ovViewportDashedLineScale = 1010; // double read/write - the viewport dashed line length/spacing scale. - Public for VS const short ovViewportHatchLineScale = 1011; // double read/write - the viewport hatch line spacing scale. - Public for VS const short ovViewportDesignTextScale = 1012; // double read/write - the viewport design layer referenced text size scale. - Public for VS const short ovViewportSlashThicknessScale = 1013; // double read/write - the viewport slash thcikness scale. - Public for VS const short ovViewportAmbientIsOn = 1014; // Boolean read/write - the viewport ambient light is ON or OFF. - Public for VS const short ovViewportAmbientBrightness = 1015; // double read/write - the viewport ambient light brightness. - Public for VS const short ovViewportAmbientColor = 1016; // WorldPt3 read/write - the viewport ambient light color. - Public for VS const short ovSetDesignLayerVisibilityInAllViewports = 1017; // short, -1 = invisible, 0 = normal, 2 = grayed - Public for VS const short ovSetClassVisibilityInAllViewports = 1018; // short, -1 = invisible, 0 = normal, 2 = grayed - Public for VS const short ovViewportHDRIBackground = 1019; // Sint32 read only - the background for environment lighting - Public for VS const short ovSectionVP2DAttributeClass = 1020; // Sint32 read only - the RefNumber of the class responsible for attributes of overall cross-section or just the x-section of structural elements. - Public for VS const short ovSectionVP2DOtherAttribClass = 1021; // Sint32 read only - the RefNumber of the class responsible for attributes of cross-section generated from non-structural elements - Public for VS const short ovSectionVP3DFillStyleClass = 1022; // Sint32 read only - the RefNumber of the class reposnsible for fill style of the objects beyond section plane - Public for VS const short ovSectionVP3DLineStyleClass = 1023; // Sint32 read only - the RefNumber of the class responsible for line style of the objects beyond section plane - Public for VS const short ovViewportXPosition = 1024; // double read only - the X coordinate of the viewport on the sheet layer - Public for VS const short ovViewportYPosition = 1025; // double read only - the Y coordinate of the viewport on the sheet layer - Public for VS const short ovViewportAngleWithXAxis = 1026; // double read only - the angle that the viewport subtends with the X axis on the sheet layer in degrees - Public for VS const short ovViewportShowWallComponents_OBSOLETE = 1027; const short ovViewportGrayTransparent = 1028; // Boolean read/write - the viewport renders gray layers transparent - Public for VS const short ovViewportFlipText = 1029; // Boolean read/write - the viewport/dlvp adjusts for flipped text - Public for VS const short ovViewportBlackAndWhite = 1030; // Boolean read/write - the viewport/dlvp draws in black and white only - Public for VS const short ovViewportUseDocumentClassVis = 1031; // Boolean read/write - set/reads the Use Document Class visibilities settings for dlvps - Public for VS const short ovViewportDescription = 1032; // TXString read/write - a description for the viewport, which corresponds to the Dwg Title field for a corresponding Drawing Label. - Public for VS const short ovViewportLocator = 1033; // TXString read/write - the locator for the viewport, which corresponds to the Item field for a corresponding Drawing Label. - Public for VS const short ovViewportIsLinked = 1034; // Boolean read - indicates whether the viewport is a linked viewport const short ovViewportDisplayPlanar = 1035; // Boolean read/write - the flag to indicate if planar and 2D objects are to be displayed const short ovViewportForegroundRenderType = 1036; // short read/write - the viewport render type. - Public for VS const short ovViewportHasCamera = 1037; // Boolean read only - whether there is a camera attached to the viewport or not const short ovCameraAttachedToViewport = 1038; // Boolean read only - whether the camera is attached to a viewport or not const short ovViewportCropVisible = 1039; // Boolean read/write - get/set the Crop Visible state of a viewport - Public for VS const short ovViewportLayerHeightIgnored = 1040; // Boolean read only - whether the viewport ignored layer height for single layer case const short ovViewportLightingDevice = 1041; // read/write - make an association between a lighting device light and an overriden light object for the viewport. const short ovViewportRePositionDimensionText = 1042; // Boolean read/write - the viewport/dlvp re-positions dimension text to other side of dimension line - Public for VS const short ovIsDesignLayerSectionViewport = 1043; // Boolean read only - indicates whether the linked viewport is a sheet layer or a design layer viewport - Public fo VS const short ovFDLSVPHiddenLineInWireframe_OBSOLETE = 1044; const short ovViewportPageSymbolScale = 1045; // double read/write - the viewport page symbol scale. - Public for VS const short ovViewportNavigateToFromSectMarker = 1046; // Boolean write only - selects the viewport and makes it visible - Not for public use const short ovViewportDetailLevel = 1047; // short read/write - low detail = 0, medium detail = 1, high detail = 2 - Public for VS const short ovViewportIsHorizontalSection = 1048; // Boolean read - indicates whether the viewport is horizontal section const short ovViewportTransformMatrix = 1049; // TransformMatrix read/write const short ovViewportViewMatrix = 1050; // TransformMatrix read/write const short ovViewportOperatingTransform = 1051; // TransformMatrix read const short ovViewportUnscaledBoundsWithoutAnnotations = 1052; // WorldRect read const short ovViewportResetForOnlyAnnotationsChange = 1053; // void write const short ovIsSectionViewport = 1054; // Boolean read only - indicates whether the viewport is a section viewport - Public for VS const short ovSheetLayerSectionViewportViewMatrix = 1055; // TransformMatrix read const short ovSectionViewportSectionViewMatrix = 1056; // TransformMatrix read/write const short ovViewportAttachDefaultRenderOptions = 1057; // Boolean(ignored) write const short ovViewportAttachDefaultCustomRenderWorksRenderOptions = 1058; // Boolean(ignored) write const short ovViewportDisplay2DComponents = 1059; // Boolean read/write const short ovViewportHiddenLineDisplay2DFills = 1060; // Boolean read/write const short ovViewportAttachDefaultLightingOptions = 1061; // void write const short ovViewportCreateDefaultEditableGroups = 1062; // void write const short ovViewportPrivateLayer = 1063; // MCObjectHandle read const short ovSectionViewportDisplayObjectsBeyondCutPlane = 1064; // Boolean read/write const short ovSectionViewportDisplayObjectsBeforeCutPlane = 1065; // Boolean read/write const short ovViewportHiddenLineDisplay2DFillsAllowed = 1066; // Boolean read const short ovSectionViewportCastShadowsFromRemovedPortion = 1077; // Boolean read/write const short ovSectionViewport2DResultsMerged = 1078; // Boolean read/write const short ovSectionViewport2DAttributesUseClass = 1079; // Boolean read/write - must be set true before you set class with ovSectionViewport2DAttributesClass const short ovSectionViewport2DAttributesClass = 1080; // RefNumber read/write const short ovSectionViewport2DOtherAttribsUseClass = 1081; // Boolean read/write - must be set true before you set class with ovSectionViewport2DOtherAttribsClass const short ovSectionViewport2DOtherAttribsClass = 1082; // RefNumber read/write
  5. As everyone has sleuthed out, hidden records are indeed in their own list. This is another instance where the Debug menu and Debug List View Ex comes in handy. Records are contained in a Data object, which contains regular records in it's standard list and hidden records in a Hidden Format container in the aux list. In theory, you could probably get there from FSymDef() and some crafty list traversal, but in VS or Python, Raymond's method is much easier and to the point.
  6. Indeed, that should work. I think when Python came out, that was the only option, and I haven't looked back.
  7. Looks like the process is a little more complex. The link information is attached to a link object in the text object's aux list. This is only possible to access using python: kLinkType = 58 ovLinkFormatUsed = 1350 ovLinkFieldIndex = 1351 auxh = hText.aux hTextLink = vs.Handle(0) while hTextLink == vs.Handle(0) and auxh != vs.Handle(0): if auxh.type == kLinkType: hTextLink = auxh auxh = auxh.next if hTextLink != vs.Handle(0): recIdx = vs.GetObjectVariableInt(hTextLink, ovLinkFormatUsed) fieldIdx = vs.GetObjectVariableInt(hTextLink, ovLinkFieldIndex) recName = vs.Index2Name(recIdx) vs.AlrtDialog( 'Field: ' + recName + ' Index: ' + repr(fieldIdx) )
  8. I think there’s a common misconception that objects don’t get created until the end of the script — for any function that returns a handle, that object the handle points to is immediately available in memory, and all operations using that handle will work. What you won’t see happen until the end of a script is the plug-in object’s code run or it’s geometry created, so if your script depends on the PIO calculating data or parsing it’s geometry, you’ll have issues. There’s a way to force an SDK plug-in to reset immediately, but I don’t think that’s the issue here. Does the name have to be unique? If so, that would cause the command to fail. The name could be set, but you just don’t see it yet. Try calling ResetObj() at the end of the script.
  9. Select everything you want to be considered as a single unit and create a symbol. Set the insertion point to the point where you want to attach to the truss. Do not keep an instance in place. In the Rigging toolset, choose Rigging Load. Attach the Rigging Load to your truss. Check the Show Symbol option, and press Select Symbol to choose the symbol you created. Set the weight of the combined hardware at the bottom of the OIP.
  10. Correct. passing vs.FSymDef() to vs.ForEachObjectInList() is probably the best method. I believe you do have to recursively enter symbol folders.
  11. I'm not entirely sure what you mean here. As Pat remarked, the Resource Manager is only an interface for working with resources. The Lighting Device accepts the name of a symbol (a resource), and copies the geometry of the symbol to the Lighting Device. Lighting Devices also take default data from the symbol on insertion, which you can mimic via script by calling vs.ApplyLightInfoRecord(). An "external reference" in Vectorworks lingo would mean that you are referencing a symbol in another file. Is that what you mean, or are you only trying to determine the connection between the Lighting Device and the Resource Manager. Mapping to a symbol outside of the current drawing file would be where Sam's RessourceList comes in. The following script will add the first row as described, assuming that "D" maps to a symbol named "My Light." It also assumes that the symbol exists in the current drawing. The neutral orientation (pan=0) is towards the top of the page. You can set a different initial orientation with the final parameter in CreateCustomObject(). symbolName = 'My Light' hNew = vs.CreateCustomObject('Lighting Device', (-61,-7.55), 0) vs.Move3DObj(hNew, 0, 0, 11.5) vs.SetRField( hNew, 'Lighting Device', 'Symbol Name', symbolName) vs.ApplyLightInfoRecord(vs.GetObject(symbolName), hNew) vs.SetRField( hNew, 'Lighting Device', 'Pan', '-7') vs.SetRField( hNew, 'Lighting Device', 'Tilt', '46') vs.ResetObject(hNew)
  12. @Sam Jones why not just use vs.GetObject() to get the symbol definition by name and vs.GetTypeN() to confirm that it's a symbol definition? Then all the Lighting Device needs it the name of the symbol.
  13. You could always define the ptr in ModuleMain and then initialize if nullptr in the OnInitXProperties events. That's assuming that you don't need to re-initialize if the user makes a change to the color table.
  14. The simple answer is, yes, this is definitely possible. Also, we're assuming you mean a Spotlight Lighting Device object and not a rendering spotlight. (Both are possible). You would use vs.CreateCustomObject() to insert a Lighting Device at the desired location and orientation, vs.HMove3D() to set the z location, and then set the Lighting Device fields for pan, tilt, and which symbol to use. The least straightforwards element is mapping the key value (e.g. "D") to the name of the symbol you want to use for the lighting device. You can hand-code a dict, read from a worksheet, attach a record to the symbol, etc.
  15. VS does not have the ability to delete or rename a field. I suspect Sam is correct -- the only solution is brute force: - Rename the old record - Create the new record - Attach the new record to the same objects as the old record - Copy all data from instances of the old record to new - Iterate over all text object in symbols, and re-link to the new record - Delete the old record The following object variables can help you work with linked text: ovTextIsLinkedToRecord = 680; // Boolean, read only - Public for VS ovLinkFormatUsed = 1350; // InternalIndex - the RefNumber of the format this links to ovLinkFieldIndex = 1351; // short - the index of the field of the format used
  16. The VP cache just literally contains the lines and polylines that make up the hidden line render. If you're annotating by the physical appearance in the VP (e.g. object heights), this could work, but you won't be able to access the drawing objects. Data tags use some special code that's not available in VS or the SDK. My guess it that the attachment tool is using the VP view and visibility settings to query objects in the corresponding design layers.
  17. @mjm My point was not that Vectorworks won't crash, but that I often hear users who think they did something wrong, or have a computer that's not up to spec, or too many browser tabs open, and don't report the bug. In my experience, crashes that are consistently reproducible and have test files and either detailed steps or videos attached get resolved fairly quickly. While VW does get crash reports from Apple and MS, there's usually not enough data in the report alone to diagnose and fix the bug.
  18. - Vectorworks should never crash, even if a user does something incorrectly, so you should report this as a bug, attaching your file and providing instructions how to reproduce. https://www.vectorworks.net/support/bugsubmit - The Light Info Record only sets Lighting Device default data, so unless you want to change the data in existing Lighting Devices, you don't need to take any further action. The symbols should be available to add to the summary as soon as you attach the LIR. - Lighting Symbol Maintenance, under Spotlight>Reports, makes managing the LIR a lot easier. It helps ensure you don't enter bad data (which could be your issue), and has an option to push out any changes to existing Lighting Devices.
  19. The layout items are all plug-in objects; insert a static text item and then change it's type to the desired item. Note, you are building more of a connected tree than a visual layout, a lot like marionette, so what you see in the VW document looks nothing like the resulting dialog.
  20. Or more specifically, the OIP configuration saves with the file. The setting in Preference will also become default for the subsequent new file. In most cases, I'm dealing with one of two scenarios: I have a house inventory, and no one is dealing with clamps in the paperwork, or I have a production electrician in charge of pulling iron, and then they're using a separate "Iron" field in LW and not an accessory in VW. Either way, I don't want clamps to show up as accessories. I also don't really care about seeing the right hanging hardware in 3D, as long as the distance below the pipe is correct.
  21. Just thought I'd mention, in addition to the solutions you can find in AutoPlot, Savvy Select Similar Instrument will do this as well https://benghiatlighting.com/software/product/savvy-select-similar-instrument-3/
  22. I figured out the issue. buildvwr.exe requires the 64 bit versions of msvcp100.dll and msvcr100.dll, which aren't included in Windows 11. I was able to grab copies from a wine install, and now the build functions without error. I'll attach here if anyone else runs into this issue. msvc*100_dll.zip
  23. @mjm I'll add that your Object Info seems to be using custom parameter settings, and is out of date. The standard configuration has "Edit Cell" and "Edit Accessory" dropdown menus under Instrument Type, which would make it more clear that you have the light's accessory selected.
  24. It's a hidden record. Get a handle to the record format via it's name. It's possible that the values get loaded into memory, so changing the stored value may have no effect.
  25. Your symbols are constructed with your clamps as accessories (this is how they default now, and I'm not in favor if this unless you're pulling a complete shop order). When SSS turns blue pre-selection, it's letting you know that you're hovering over an accessory. You're not changing your Lighting Devices to accessories; what you're seeing is the tool selecting all the clamps for you and setting that as the active component to edit in Object Info. Either remote Light Info from the clamp in your lighting symbols, or be careful where you're clicking. HTH
×
×
  • Create New...