Jump to content

MullinRJ

Member
  • Posts

    2,007
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. Hello @Baptiste_02, After rereading my script, I cannot see anything that would cause what you describe. If you relaunch VW, how many times can you run the script before it starts to misbehave? Perhaps you could upload a file where this problem happens. Others may be able to spot something I didn't, but off the top of my head I don't see anything wrong with the script. Also, you should create a signature showing the version of VW you are using, and your computer specs. This saves people from having to ask, and it may also help someone recognize something relevant to your setup. All the best, Raymond
  2. Thank you @Maarten DE, You clarified the use of this command for me. I was assuming it was akin to the menu Modify>Compose which joins two polys to make a longer poly, when it actuality it is akin to the menu Modify>Add Surface. The function's description, or lack thereof, left me hanging once again. Many thanks, Raymond
  3. Has anyone ever gotten this function to work? The function's description in the Script Function Reference and on the Developer's WIKI reads as follows: There is not much else to go on. I've tried it with 2 Polygons, with 2 Polylines, and with a Polygon and Polyline. In all cases, two vertices of each were touching. Reversing directions of one or both Polys did not help. Tried in VW 2024 and in VW 2015 with the same results. Also there is no description for the function of the dFDuzz input, nor is there an expected range of input values. I tried 0, 1, 2, 0.1, 0.5, 0.01, 0.001, 0.0000001, 1.1, 2.5, 8, 10, 100, 1000, 10000000, all to no avail. I even tried negative values – Nada. To answer an obvious question; yes, the handles passed in were tested to be valid, and the handle returned was NIL on every try. Any guidance would be appreciated. Thanks, Raymond
  4. Hi @Jayme McColgan, There are many ways to get to where you want to go. What Tui said is the first step. After that, you can move the text as a 3D object, and/or rotate it in 3D. You can also set a Front or Side view and rotate and move it with 2D commands. Or, you can use the vs.SetEntityMatrix() command which defines a plane's origin and its rotations, then places the text on that plane. There are other ways, but they have oddities that are not worth the effort to go into right now. If you already have an object on a Working Plane, you can get its Planar RefID, and change the text's RefID to match, causing it to jump to that plane. However if you are starting from scratch and defining a plane as you create your text, the methods defined in the first paragraph should get you there. Raymond
  5. Hey @SamIWas, Actually Pen Pat=1 is the background LineStyle (pen pattern) and Pen Pat=2 is the foreground LineStyle (pen pattern). The same is true for the Fill Patterns; Fill Pat=1 is the background fill pattern and Fill Pat=2 is the foreground fill pattern. The colors for foreground and background Pens and Fills track accordingly. The real confusion belongs to VW assigning the default Pen Style as 2 (foreground - which makes sense), BUT the default Fill Pattern is 1 (background - which has been "wrong" for more than 3 decades - IMO.) When you select SOLID from the Attributes Palette for Pens you get the Foreground Pattern - PenPatN(2); but selecting SOLID for Fills, you get FillPat(1). Users don't care, because they assign patterns and colors from the UI palettes and everything works. Programmers are the ones who have to know where the wrinkles are. Welcome to the Wrinkle Conscious Club. I could pontificate more, but we're way past the point of that affecting anything. Raymond
  6. @Marissa Farrell, This is a shot in the dark. Try ResetBBox(). I've had luck with it in the past when RedrawAll didn't work. No guarantees, just a suggestion. Raymond
  7. Hey @Pat Stanford, Yes, I'm always up for a challenge. Buuuuut, this time I think I may not be your best tag-team candidate. First off, you're doing ARCHie stuff. Second, you're dabbling with WALL properties. Both are somewhat out of my wheelhouse. That said, I jumped into the deep end first and attacked the Worksheet function, and the worksheet example in the file @J P posted. If you can imagine the sound of a brick wall being impacted, I made it. Next I simplified, and drew a Wall, selected it and ran a simple script to return its TYPE and its ObjVar value for 1212. I got 68 and '', as I did when I made the brick slamming sound. I then opened the ObjectVariables.h (for VW 2023) file and saw that 1212 was defined as you said it was : const short ovArchStyleFireRating = 1212; // TXString read/write - The fire rating (insertion option) - Public for VS Next, I took my script and Wall back to VW 2020 and tried again. This is where things got squirrelly, even for me. The script result was the same, but I couldn't find anything FIRE related in the OIP like I could in VW 2023; so I opened the SDK file MiniCadCallBacks.h (for VW 2020) and saw the following: const short ovArchStyleMark_OBSOLETE = 1207; // Obsolete const short ovArchStyleDescription_OBSOLETE = 1208; // Obsolete const short ovArchStyleFunction_OBSOLETE = 1209; // Obsolete const short ovArchStyleExterior_OBSOLETE = 1210; // Obsolete const short ovArchStyleLoadBearing_OBSOLETE = 1211; // Obsolete const short ovArchStyleFireRating_OBSOLETE = 1212; // Obsolete const short ovArchStyleCombustibleConstruction_OBSOLETE = 1213; // Obsolete const short ovArchStyleCompartmentation_OBSOLETE = 1214; // Obsolete const short ovArchStyleUValue_OBSOLETE = 1215; // Obsolete const short ovArchStyleRValue_OBSOLETE = 1216; // Obsolete const short ovArchStyleAcousticRating_OBSOLETE = 1217; // Obsolete const short ovArchStyleCostIndexSystem_OBSOLETE = 1218; // Obsolete const short ovArchStyleCostIndexCode_OBSOLETE = 1219; // Obsolete const short ovArchStyleModel_OBSOLETE = 1220; // Obsolete const short ovArchStyleManufacturer_OBSOLETE = 1221; // Obsolete const short ovArchStyleURL_OBSOLETE = 1222; // Obsolete Also obsolete are similar values in the 1118 to 1157 range. In VW 2023, the values 1207 to 1222 have defined values, but in VW 2019 to VW 2022, they are defined as OBSOLETE. I didn't check any earlier. I'm assuming the ObjVars are not returning values in VW 2023. Maybe they should be, but I have no way of knowing. This seems like a factory question, unless @JBenghiat knows off the top of his head. PUNT, the ball is now back in your court. Sorry Pat, that's all I've got. Raymond
  8. Well, with Pat's input, I'll try again. 😉 ************ Short answer, YES. Python uses indentation, even when submitted from Vectorscript. I typically build my Python code in a text block, then execute it all at once. However, in your simple case you can do this, which works. It avoids the need for indentation. Not an answer, but more of a crutch. PROCEDURE test_pythoncontext; CONST Tb = c h r(9); { remove extra spaces before running code } CR = c h r(13); { remove extra spaces before running code } VAR check :BOOLEAN; BEGIN check := true; PythonBeginContext; PythonExecute('import vs'); PythonExecute('check_py = vs.GetVSVar("check")'); PythonExecute('if check_py: check_py = False'); PythonExecute('vs.SetVSVar("check", check_py)'); PythonEndContext; message(check); END; Run(test_pythoncontext); OR, build everything ahead of time, then execute it like this: PROCEDURE test_pythoncontext; CONST Tb = c h r(9); { remove extra spaces before running code } CR = c h r(13); { remove extra spaces before running code } VAR check :BOOLEAN; PyCode :Dynarray of Char; BEGIN check := true; PyCode := concat('import vs', CR); PyCode := concat(PyCode, 'check_py = vs.GetVSVar("check")', CR); PyCode := concat(PyCode, 'if check_py:', CR); PyCode := concat(PyCode, Tb, 'check_py = False', CR); PyCode := concat(PyCode, 'vs.SetVSVar("check", check_py)', CR); PythonBeginContext; PythonExecute(PyCode); PythonEndContext; message(check); END; Run(test_pythoncontext); One benefit of building your python code this way is you can print your PyCode variable to examine it while you are debugging. For short snippets, use: AlrtDialog(PyCode); Or for longer snippets, use: MoveTo(0,0); CreateText(PyCode); When it looks correct, then you can execute it. HTH, Raymond
  9. OK, I can post text, but not code. How long will this last?
  10. @hharker, The reason your import failed is because you saved the file with a ".txt" extension, which tells the Import Script... menu to treat the script as Vectorscript. If you save your file with a ".py" extension, the Import Script... menu will treat it is a Python script. Or you can do as @michaelk suggests above, which is good if you plan to run a script more than once. Sometimes you have to help the machines. They are made in our image and likeness, and therefore suffer the same shortcomings. 😉 Raymond
  11. Haven't seen it. It looks like a bug. How many vertices in that polyline? Can you post the file? Raymond
  12. @Janvin Lowe, I am glad the plug-ins work for you. What you are showing above looks similar to what I see when I say the outline text is shifted (on a PC.) This shows two nearly identical text blocks, except for color and position. In the first image, the red one is shifted slightly down to show that they are aligned horizontally. After moving the red text directly atop the blue one, I converted the red one to Outline then selected both text blocks again before taking the screen shot. Notice how the outline characters shift to the right. The text insertion points are still coincident, and the bounding box grips are still perfectly aligned, but the red outline text extends beyond its bounding box to the right. When I edit the red text, the edit cursor lines up between the blue characters, just like you describe. Likewise, if I apply the Underline attribute to the red block, the underlines line up under the blue characters, again like you describe. My guess is that this is just how VW displays Outline Text on a PC. Technically, it is not supported, so we can't really complain. You can always post a WISH item on the Forum, but be prepared to wait. If the shift doesn't bother you then you should be good to go. Raymond PS - You didn't report your OS. I am still curious what system you are using. If you would, please create a signature for this forum in your User Account Settings - Signature. At the very least, include your VW version, and your OS. It will save a lot of back and forth every time you post a question or problem, as the two most frequent questions will have already been answered. Thanks.
  13. For VW 2018: Text PLAIN.vsm Text OUTLINE.vsm Toggle Text OUTLINE .vsm @Janvin Lowe, since I know you are using VW on a PC, would you please report back how these work for you? The only oddity I see is the text shifts right when it is converted to Outline, but it shifts back when it is reset to Plain. I'm curious if this is because my PC is still running Windows 7. Also report your OS. Thank you, Raymond
  14. Hello @Janvin Lowe, In the standard UI, there is no assigned hotkey for that menu item, nor for any other of the Text Styles (Bold, Italic, etc.) to the best of my knowledge. If you do find a hotkey combination that makes text Outline, I'd like to know what it is. I've not run into it before, but that doesn't mean it doesn't exist. If you want the capability to make text objects Outline on the PC (or Mac) via a hotkey, add the three menu command plug-ins below to your workspace. In the Workspace Editor you can add them to one of your menus, or to a new Custom menu. You can then assign hotkeys to them. They can be found in the TEXT category in the Workspace Editor. These plug-ins were compiled in VW 2020. If anyone needs them in an earlier version, please write back. One shortcoming is that these scripts do not address individual character editing. It's all, or nothing, but the scripts are unlocked, so have at it. Text PLAIN.vsm – Remove all Text Style formatting (Bold, Italic, etc.) from the selected text objects. Text OUTLINE.vsm – Make all characters OUTLINE in the selected text objects. All other formatting is cleared first. Toggle Text OUTLINE.vsm – Switch each character's Outline attribute (ON or OFF), on a character-by-character basis. Existing formatting will remain. Only the Outline attribute will change. Text PLAIN.vsm Text OUTLINE.vsm Toggle Text OUTLINE.vsm HTH, Raymond
  15. Hello @Janvin Lowe, There are several ways to convert text to outline. The most obvious is to select the "Outline" text attribute in the OIP, assuming it's available. Another way is to convert the text to poly lines with the menu item Text > Convert Text to Polylines. A third way is to use the Format Text dialog and select the Outline attribute or click its hotkey (Cmd/Ctrl-O) (MAC Only), but you also have to click OK. Lastly, a script can change the text to Outline or to Polylines. Scripts can exist in the document, or in the Plug-in library. A Menu Command Plug-in loaded in your workspace can set the text attribute to OUTLINE, and a Plug-in can have a hotkey. If you didn't put it there, this is unlikely. I just verified that text CAN show as outline in VW on a PC, but you have to access it via script. The OIP and Text menu items do not show the Outline option on a PC. It may be too late to ask, but once you had outlined text, was the object showing as Text in the OIP, or showing as a Group? Or if you didn't look at the OIP, did you still see the little "x" on the object indicating the Insertion Point? This would indicate that the Text object had the OUTLINE attribute assigned. If there was no "x" or the OIP said Group, then the text was converted to Polylines. If you converted the text with a keystroke, check the menus under the TEXT menu for hotkeys that may be assigned to Convert Text to Polylines or Font Style > Outline. Unless you (or someone you know) edited your workspace, these menus typically do not have hotkeys, but you can add hotkeys to them with the Workspace Editor. Then check any custom menus you may have loaded for a plug-in that sets the text attribute to outline, and does it have a hotkey assigned? This is a long shot, but it is possible. If this ever happens again, before you hit Undo, check the Type of the selected object(s) in the OIP for Text or Group. After you Undo, look in the lower right of the VW window, as a message will display showing what action was undone. You can Redo (Cmd/Ctrl-Y) then Undo (Cmd/Ctrl-Z) to see the message again. I doubt this explains what happened, but if it ever happens again you should be able to track down the cause. Raymond
  16. @Pat Stanford ran into that a week or so ago. You’re in good company. 😋 Raymond
  17. Peter, Do you still have the file in question? You can send it this way if you want. Raymond
  18. Hello, @bbrown6. I just saw this post. How many files are you talking about? I have the old software and Ye Olde Systems needed to do conversions. Please send me a PM if you still need help. Raymond
  19. Here's a partial map of the Object Variable numbers for the Viewport Lighting Options dialog. ObjVars 1014 and 1302-1304 are described above. ObjVar 1269 is clear as mud. ObjVar 1269 is another object variable that you can read, but cannot set. Or at least I have not found a successful way to set it. If you read it with GetObjectVariableInt(), or GetObjectVariableLong(), you will get the numbers 0-3, or 5 which correspond to the settings shown below. If you try to set the object variable, the values and the menu don't change. I assume the inability to write to variables 1269, 1303, and 1304 is a bug and I'll report it in the morning. If I find out it's WAD, I'll post back so you know, otherwise I'll post back when it gets fixed. Sorry this didn't turn out better. Raymond
  20. @Fuge, REDO... Now that I have played with it a little, I'm going to revise my previous guess. With ObjectVariables 1014 and 1015, I can read and write to both Viewport variables: VP_Amb := GetObjectVariableBoolean(VPhand, 1014); { Viewport Ambient } VP_Amb_Bright := GetObjectVariableReal(VPhand, 1015); { Viewport Ambient Brightness } SetObjectVariableBoolean(VPhand, 1014, True/False); { Viewport Ambient On/Off } SetObjectVariableReal(VPhand, 1015, 0.37); { Viewport Ambient Brightness - 0.0-1.0 } However, I can read and write to ObjectVariable 1302. AO_On := GetObjectVariableBoolean(VPhand, 1302); { Ambient Occlusion } SetObjectVariableBoolean(VPhand, 1302, True/False); { Ambient Occlusion On/Off } But, I can only read ObjectVariables 1303, and 1304. AOStrength := GetObjectVariableReal(VPhand, 1303); { Ambient Occlusion Strength - 0-100 } AOSize := GetObjectVariableReal(VPhand, 1304); { Ambient Occlusion Size } If I change the values for "Ambient Occlusion Strength" and "Ambient Occlusion Size" in the Lighting Options dialog box, I can read my manual changes, but if I try to set the values by script, the settings do not take. More on the "Indirect Lighting" setting in the next post. HTH, Raymond
  21. Dave, I haven't tried these, but give them a whirl. They look promising. SetObjectVariableBoolean(LYRhand, 150, True/False); { Layer Ambient On/Off } SetObjectVariableReal(LYRhand, 151, ###); { Layer Ambient Brightness - 0-100?; you'll have to figure out the range. } SetObjectVariableBoolean(VPhand, 1302, True/False); { Ambient Occlusion On/Off } SetObjectVariableReal(VPhand, 1303, ###); { AO Strength - 0.0-1.0? or 0-100?; you'll have to figure out the range. } SetObjectVariableReal(VPhand, 1304, ###); { AO Size - you'll have to figure out the values. } HTH, Raymond
  22. Use: SetObjectVariableBoolean(LNewObj, 1160, False); after you create the text to place it on the Layer Plane. I’ll post an example when my internet comes back. Raymond
×
×
  • Create New...