Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

146 Spectacular


About MullinRJ

  • Rank
    1000 Club

Personal Information

  • Occupation
    Circuit Board Designer
  • Location
    Dallas, TX

Recent Profile Visitors

1,639 profile views
  1. @hagemeijer , If you have a handle to an ARC (or CIRCLE) object, you can't GET the radius directly, but you can calculate it: GetArc(H, Start, Sweep); Radius := hPerim(H) / Deg2Rad(Sweep); where "H" is the handle to the object. OR as Josh says: Get2DPt(H, 1, Pc.x, Pc.y); Get2DPt(H, 2, P1.x, P1.y); Radius := Norm(P1-Pc); where "H" is a Handle to the object and Pc and P1 are Vectors. Raymond
  2. Sam, I assume from your description you want to preserve the "L" shape. If the objects are drawn in a way that adjacent objects are next to each other in the stacking order, AND each object's BBox overlaps (or touches) the BBoxes next to it, you could create a Polygon for each object's BBox and add the Polygons together with the AddSurface command. When you are done they will all be connected but not necessarily in a "pretty" fashion. However, if there are gaps between the individual BBoxes, this approach won't work. Any approach you take that will work will be very dependent on the configuration of shapes before you start. Raymond
  3. Sam, A new Group is always created on top of the stacking order, so if you are on a design or sheet layer, LActLayer will return a handle to a new Group. If you are drawing inside a container, you can use the Waldo method that Pat mentioned. With the handle you can then get the Group's BBox. Raymond
  4. @hagemeijer , Try 695, but note it is a Longint ObjVar. Raymond
  5. Samantha, "Sanctuary Floor Plan.vwx" and "Eaton Hall Floor Plan Renovations.vwx" do not appear to be VW files when opened with a text editor. They both start with headers that look like they may be AutoCAD files. "Sanctuary Floor Plan.vwx" starts with "AC1018" and, "Eaton Hall Floor Plan Renovations.vwx" starts with "AC1021". Change their file extensions to".dwg" and open them with AutoCAD, or import them into the program of your choice (that reads DWG files). The other two files are VW files. I'll let someone with better experience in doing DWG Exports help you there. Raymond
  6. Hi Sam, That's the change I thought would have the most impact on your problem, yet I'm not exactly sure what vsoStateAddCurrent() does under the hood. It's one of those things that works and I have not spent any time trying to figure out more about it. As you surmised, that is the only statement I have under that event in all of my PIO's. If you ever find another example on how it's used differently, please let me know. Happy New Year, Raymond
  7. Hi Sam, I have only two suggestions which I've marked with comments in your code. Try them one at a time to see if either of them works. Then try them together if neither works. After that, I'm out of ideas. 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); IsNew := IsNewCustomObject(PIOName); BoxBottom := 3 * UPI; CASE EventMessage OF kResetEventID: { 3 } BEGIN { MOVE vsoStateGetParamChng LINE FROM EVENT 44 TO EVENT 3 } ParamChangeFlag := vsoStateGetParamChng(PIOHan,ParamChangeWidget,ParamChangeIndex,OldParam); GetSymLoc3D(PIOHan, PIOX, PIOY, PIOZ); ParamChangeFlag := vsoStateGetParamChng(PIOHan,ParamChangeWidget,ParamChangeIndex,OldParam); AlrtDialog(concat('Event 3, kResetEventID triggered', kcr, 'ParamChangeFlag = ', ParamChangeFlag, kcr, 'EventMessage = ', EventMessage, kcr, 'MsgData = ', MsgData)); IF (ParamChangeFlag=True) THEN BEGIN {Do Stuff} END; {IF (ParamChangeFlag=True) } ParamChangeTrig := FALSE; PIOChangeTrig := FALSE; SetUp; MainConstruct; vsoStateClear(PIOHan ); END; { 3 - kResetEventID } kObjOnAddState: { 44 } BEGIN {This event is needed to track state changes} { CHANGE EventMessage TO MsgData (x2) in following line } MsgData := vsoStateAddCurrent(PIOHan, MsgData); AlrtDialog(concat('Event 44, kObjOnAddState triggered', kcr, 'ParamChangeFlag = ', ParamChangeFlag, kcr, 'EventMessage = ', EventMessage, kcr, 'MsgData = ', MsgData)); END; { 44 - kObjOnAddState } 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; { 5 } kObjOnWidgetPrep: { 41 } BEGIN WidgetPrep; END; { 41 - kObjOnWidgetPrep } END; { case } Have a Merry Xmas, (or holiday of your choice), Raymond
  8. Hi Sam, Do you have your call ParamChangeFlag := vsoStateGetParamChng(PIOHan, ParamChangeWidget, ParamChangeIndex, OldParam); in Event 3 (kResetEventID)? Everything else you have in your kObjOnInitXProperties event is what I have, though you call SetPrefInt(590, 1 ); {kParametricEnableStateEventing} twice, where I only call it once at the end of Event 5 (kObjOnInitXProperties). I doubt it makes a difference, but I don't know. Also, do you have "Event-Based" checked in the "Edit Plug-in Definition" dialog, Options tab? Lastly, I execute these 3 commands first before I enter the CASE statement testing the events: result := GetCustomObjectInfo(PIOName, PIOHand, recHand, wallHand); IsNew := IsNewCustomObject(PIOName); vsoGetEventInfo(theEvent, theMessage); The first line makes sure the PIOHand variable is valid, and the third line returns the current EVENT. Raymond
  9. Hi Andrea, You forgot to mention which version of VW you are currently using. Since the latest versions will open at least back to VW 2013, I saved your files in that format. If you need an earlier version, let me know. MC4 to VW2013 Files.zip All the best, Raymond
  10. @PatW , This may be related to a bug I filed in May (for regular VectorScript, not SDK) – (VB-160901) VS SetStaticTextColor() does not work in VW 2020. StaticText color assignment works is VW 2019, but not VW 2020. It still shows to be unresolved. Raymond
  11. To which release version are you referring? SP0 - it's broken. SP1 - is usually a release for localization changes and not bug fixes. SP2 - is not out yet. I expect it in this or SP3 at the latest. Just guessing here. As recommended above, I'd use VW 2019 for your designs needing this feature until VW 2020 is updated and working. The file(s) can be moved forward after it's working. I feel your pain. Raymond
  12. Nicolas, thank you. That is exactly what I was looking for. Usually I look at the HTML and the Dev Wiki pages for calls that are confusing or under documented. I missed this one. I guess it wasn't confusing enough. Now to find out why WriteXMLMemory() seems to work, yet kicks a -21 error (Invalid XML handle). Oh the joys of programming. Again, thank you. Raymond
  13. Does anyone know were a list of XML errors may be published? The following script was copied from the Developer Wiki from the VS:WriteXMLMemory() page. I modified it to trap any XML error generated along the way. On my computer running VW 2019 it generates an error for WriteXMLMemory(). The error is -21. Even with the -21 error, the function writes a value to variable "mem" which I display at the end of the program regardless of any errors. PROCEDURE test; VAR xml : LONGINT; err : INTEGER; mem : DYNARRAY OF CHAR; value : STRING; BEGIN mem := ''; xml := InitXML; err := CreateNewXMLDocument(xml, 'root'); if (err = 0) then begin err := SetElementValue(xml, '/root/value', '34'); if (err = 0) then begin err := WriteXMLMemory(xml, mem); if (err = 0) then AlrtDialog(mem) else AlrtDialog(concat('Error= ', err, ' in WriteXMLMemory()')); end else AlrtDialog(concat('Error= ', err, ' in SetElementValue()')); end else AlrtDialog(concat('Error= ', err, ' in CreateNewXMLDocument()')); err := ReleaseXML(xml); if (err <> 0) then AlrtDialog(concat('Error= ', err, ' in ReleaseXML()')); { Show value of variable "mem" w/ or w/o XML errors } AlrtDialog(mem); END; RUN(test); TIA, Raymond
  14. @rjtiedeman , Applying a FILL to an EXTRUDED Line was reported as a bug recently and now shows to be fixed. I assume the fix will apply to SWEPT Lines, too. I think this is only a temporary setback. Fingers crossed. Raymond
  15. Hi Pat, I did not draw the poly correctly. When I look at the drawing again I see the the thin pink line hugging the round walls. That definitely puts the right round wall OUTSIDE the poly by a distance of the wall's radius since, as you said, the round wall's center point is what is being tested. So, NO, it is not a matter of decimal precision. My bad. If someone wants to test the "solid" part of a round wall for inclusion in a Poly's interior, they will have to write a separate routine to test the endpoints and at least one point along the wall for inclusion. Doable, but tedious. The "LOC=" criteria is inadequate for this task. Just now I tested the straight wall, curious how it would test if one endpoint is OUTSIDE the Poly. It tested as INSIDE, until I pulled the endpoint enough that the center point of the straight wall was also OUTSIDE the poly. Then it tested as OUTSIDE. So it seems "LOC=" is only testing center points of objects for inclusion, and not edges. That's a significant caveat. Programmer beware!!! Here's another interesting scenario: draw a straight wall with both endpoints OUTSIDE the poly, so that only its center point is inside one of the poly's corners. It will test as being INSIDE using the "LOC=" criteria. Thanks Pat. Raymond


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