Jump to content

_c_

Member
  • Posts

    2,434
  • Joined

  • Last visited

Everything posted by _c_

  1. Ciao @michaelk, no, nothing new there. I illustrate here the code that you mentioned: resultStatus := GetCustomObjectInfo(objName, objHd, recHd, wallHd); sets all basic variables to operate on the running plug-in code objName universal name of the running plug-in objHd handle of the running plug-in as instance of a definition (record, type 48) recHd handle of the running plug-in definition (record, type 47) wallHd for wall-insertable objects, handle of the parent wall (if any) ControlGeometry := GetCustomObjectPath(objHd); Handle to the custom path, an optional geometry that lives inside the path group of the plug-in. This is only relevant for path-based plug-ins or plug-ins where this has been enabled. Point, rectangular or linear plug-ins won't have a path group by default. For those who don't know, plug-ins can have special groups. Profile and path groups, such as for Extrudes along path where the path is used for extruding a given profile. The two special groups can be imagined as "outside" the document and the plug-in. As a repository available for that plug-in. Your plug-in might return an error if you try to use a NIL handle returned by GetCustomObjectPath, but there is no such special group. IF you enable Events, you will be able to code special actions for given events on your pio. For example you might want to be able to edit it as a polygon (and your PIO is a path pio). I posted an example of event enabled Plug-in using various events (such as disclosure widgets) a few weeks ago: SetObjectVariableBoolean(objHd, 800, TRUE); Enables text operations on the running pio. This will allow to set the text size and font of the pio using the usual text commands. Mind, this won't make it respond to anything else, such as horizontal and vertical text alignments. Every plug-in object runs "twice" when the developer mode is activated. Either in the VW prefs or by script using SetPref(21, TRUE);
  2. Hello everybody, I transferred the Object Events article previously on Vectorlab to the Developer Wiki: https://developer.vectorworks.net/index.php/VS:Object_Events This article was written by Charles Chandler on 2007, and is still very useful. Ciao, _c_
  3. There. It just drove me nuts for the second time. Here the solution: Revit 2021 > View > Visibility / Graphics Tab: Model Categories Expand Item: Generic Models Switch off: IfcOpeningElement
  4. VW doesn't. It targets the small praxis or singular architect. Preferably American. For this target VW is the best value for its money. And I still would recommend VW to any young professional starting up an office.
  5. I can confirm all that's said so far. Below the old example from Jeff Geraci adapted: the index is 0-based, SelectChoice selects only the last used index in the loop, unregarded the fact that the List Box accepts USER multiple-selection. It indeed doesn't seem to translate into scripts. Dev states about List Boxes Scripted API functions for retrieving and managing pulldown menu control options also work with list box controls. So it is entirely possible that since Pull-down menues don't support multiple selection by script, the functionality is missing here too (whereby I did once succeed into having multiple selection in pull down menus). Caro Sam, I would definitely file it as bug, it does feel totally wrong. (* { draws a muliple selection list box 25 characters wide and 7 rows high } CreateListBoxN(2,10,25,7, true); *) { Jeff Geraci, Vlist, Re: List Box, 10 Jun 2005 } PROCEDURE MultiSelListBox; CONST kChooseOK = 1; kChooseCancel = 2; kListBox = 5; kButton = 6; VAR dlogID, result : LONGINT; selCh, i : INTEGER; sel1Str : STRING; sel2Str : STRING; sel1, sel2 : INTEGER; PROCEDURE DialogProc(VAR item: LONGINT; data: LONGINT); BEGIN CASE item OF SetupDialogC: BEGIN AddListBoxTabStop(dlogID, kListBox, 6); AddListBoxTabStop(dlogID, kListBox, 13); AddChoice(dlogID, kListBox, '1a 2abcd 3-123', 0); AddChoice(dlogID, kListBox, '1ab 2abc 3-8653', 1); AddChoice(dlogID, kListBox, '1abc 2ab 3-54754', 2); AddChoice(dlogID, kListBox, '1abcd 2a 3-5432', 3); FOR i:= 0 TO 3 DO SelectChoice(dlogID, kListBox, i, true); { SetSelectionRange(dlogID, kListBox, 0, 3); } { doesn't work } END; kChooseOK: BEGIN { Get first two selections } GetSelectedChoiceInfo(dlogID, kListBox, 0, sel1, sel1Str); GetSelectedChoiceInfo(dlogID, kListBox, sel1+1, sel2, sel2Str); END; END; END; BEGIN dlogID := CreateLayout('List Box', false, 'OK', 'Cancel'); CreateListBoxN(dlogID, kListBox, 40, 10, true); SetFirstLayoutItem(dlogID, kListBox); result := RunLayoutDialog(dlogID, DialogProc); Message('Selections: ', sel1, ' & ', sel2); END; Run(MultiSelListBox); { The last parameter of CreateListBoxN indicates whether the list box should be a multi-selection list box. A list box cannot be changed from single-sel to multi-sel (or vice-versa) at runtime. To retrieve the values, use GetSelectedChoiceInfo in a loop. Pass 0 for atChoice to retrieve the first selection, and choiceNumber will contain the index of that item. To retrieve the next one, pass choiceNumber + 1 for atChoice. Repeat this process until -1 is returned for choiceNumber. Also, if no items are selected in the list box, -1 will be returned for choiceNumber. Regards, Jeff Geraci Nemetschek North America }
  6. Grazie Vlado, I bring it on dev, Charles' article is very very good, helped all of us. People will love to have it back! It can be updated and expanded once is there.
  7. Init properties: During the init event you set up the Object Info Palette behaviour and other things: if theEvent == kObjOnInitXProperties: If you want to use buttons and/or Custom pull-down menus you need to turn on UIoverride: ok = vs.SetObjPropVS( kObjXPropHasUIOverride, True ) IF, and only IF, you also want to use custom pull-down menus loading custom values, you will also need to enable custom widget visibilities. If you do this, you cannot use vs.SetParameterVisibility or vs.EnableParameter, which use parameter names, you can only use vs.vsoWidgetSetVisible and vs.vsoWidgetSetEnable. These need parameter indexes, so you must keep track of the parameter indexes and store them somehow as file. This does add complexity (I have a sub auto-filling a list as text into the right place): # not used in the test example: vs.SetObjPropVS(kObjXHasCustWidgetVisibilities, True); # only needed for custom pull-down menus with special lists of values # after enabling this prop you need to set visibilities during event kObjOnWidgetPrep To have the lovely widget groups, you must enable them ok = vs.SetObjPropCharVS( kWidgetGroupMode, vs.Chr(kWidgetGroupAutomatic), True ) # add widget groups Add parameters as static text turn the static text into separators. Mind that the routine vs.vsoInsertWidget takes a string and places it in the Object Info Palette. You can use the localised parameter name. Since the function (boo, locParmName) = vs.GetLocalizedPluginParameter(pioRecName, univParmName) returns two vars, it cannot be used directly, so I created one simple sub named O_GetLocParmName that does that: return only a string. ok = vs.vsoInsertWidget( cP___div0 -1, kWidgetSeparator, cP___div0, 'parameter name', empty); # it is advisable to use the localized name ok = vs.vsoInsertWidget( cP___div0 -1, kWidgetSeparator, cP___div0, O_GetLocParmName(gPio_N, '__div0'), empty); # O_GetLocParmName is a subroutine that fetches only the string, dropping the boolean, # so I can use it directly in vs.vsoInsertWidget def O_GetLocParmName(pioRecName, univParmName): (boo, locParmName) = vs.GetLocalizedPluginParameter(pioRecName, univParmName) return locParmName add indenting levels. These turn the widgets into expandable widgets. Don't omit to set the 0-levels, or things are going to mess up: titles = [cP___div0, cP___div1, cP___div2] for i in range(vs.NumFields(gPioRec_H) +1): if (i in titles): vs.vsoWidgetSetIndLvl(i, 0) else: vs.vsoWidgetSetIndLvl(i, 1) Warning: you will need to close and re-open your document to see widget groups display properly EVERY time you change something in the parameter index list (add, delete parameters)
  8. Explanation: The plug-in needs to be event enabled: you do this in the Options tab of the Plug-in editor: If you work on Python with external files, the plug-in needs to reload the code, so you must turn off caching during development: Here I break down the events employed. There are bucketloads of events, you'll find them in the SDK: MiniCadHookIntf.h and it does take a lot of time to be comfortable with their usage. Some of them I have really no idea what they do, and believe me, I did spend an inordinate about of time on them. The two major files you might want to study are these, but there is far more (the SDK version is here just irrelevant): The code for the plug-in runs a number of times (and double as much if the developer mode is on), vs.GetCustomObjectInfo is compulsory for fetching the needed basic variables: (ok, gPio_N, gPio_H, gPioRec_H, gWall_H) = vs.GetCustomObjectInfo() Every time the code runs, you must fetch the type of event involved and eventually do something during that event. vs.vsoGetEventInfo is compulsory for fetching event info: (theEvent, theButton) = vs.vsoGetEventInfo() # whereby theButton is a generic message (theEvent, aMessage) = vs.vsoGetEventInfo()
  9. About text alignments: you can set a plug-in object to respond to font and text size using vs.SetObjectVariableBoolean(gPio_H, 800, True) but all other text properties, such as horizontal and vertical alignment, etc. must be coded and driven by parameters.
  10. Hello, I was Vectorlab in form of Orso.B.Schmid. The event article was written by Charles Chandler somewhere around 2007, I can bring his work into the dev wiki, but there is documentation and @Vlado certainly will want to do it right, a lot happened ever since. If Vlado gives me the go, I'll bring it there until he has something better.
  11. It is a total coincidence, I have been called in for another thread from the German Forum. Quite spooky, though.
  12. There is a question on the German VW forum about plug-ins with dividers and buttons. An ever recurring topic. I am [ever] switching to Python, and I though it could be a nice exercise for me to try it pythonically. Note: this article has been transferred to the Developer wiki for easier maintenance, it is now a subpage in my User space: https://developer.vectorworks.net/index.php/User:CBM-c-/Plug-in_with_widget_basic_example Expand the test file into your User's plug-in folder (there is no installer here) Test.zip The Test PIO _c_ plug-in: uses an external file source (you don't need to script in the Plug-in Editor) is event enabled has a button triggering a script has dividers turns the dividers into expandable group widgets doesn't resolve text alignments, so that will take the active document's settings I am new to Python and am sure that this can be done more efficiently, I'll throw it thus here in the forum, let's learn.
  13. @Dave Donley, I used them recently for their shadows. I must say, I fell in love with them...
  14. Where can I vote this up in a way that it will come true.
  15. And I expressly ask for this victim not to be Matt Panzer. The Barn door, albeit the most ridiculously named building thing in VW, was done very well. BTW, did anyone ever quantified, for real, the image damage done by that name -Barn- outside USA? Did anyone?
  16. I am fully of your opinion: whoever decides that Irrigation and Barn doors are a priority should please be tied up to a screen displaying non-stop our rants.
  17. Not only that, it works now without any tricks, no need to rename things! It just works perfectly. Thank you so much for reacting so promptly to this.
  18. There are the options to Rotate in Wall and/or in Symbol. If your elements can be made into symbols, you might be able to optimise the needed hatches using that option. Then you wouldn't need a rotation at all. But reading your mail it doesn't sound like this is feasible. I keep a subset of hatches for a few options: background (B) rotate in wall (W) and rotate in symbol (S). I wouldn't know how to otherwise optimise, aside of scripting something, which, in this case, would only make sense if this action was really recursive. Any script would have you to choose a line representing the hatch rotation and...then you can just as well use the Attribute Mapping tool on one object and transfer by pipette the edited mapping on other objects. Edit: add screenshot of the Attribute Mapping tool, which is often unknown. This allows to move/rotate/scale any vectorial fill (hatch/gradient/img/texture) directly on the object. It is awesome. Or, as Tom suggested, apply a saved hatch variant on a multiple selection from the Resource Manager and that can hardly be made faster. I hope this helps.
  19. As far as I know, for now there is nothing comparable to Solibri office when you need total check control. BIM Collab seems to want to move into the Solibri monopoly, though. Stay tuned on that.
  20. They certainly seem to like the plugin as it is, as shocking as it might be to us. The reputation damage done by selling the international version as it is, is huge. And it's not a matter of adding configurations, it's a matter of how the tools draw in 2D, at least here. An environment where one barely speak German.
  21. There has to be a new, honest and straightforward approach to these VW presentations. They are pretty much at the borderline. No. They are over now. They are cheating beyond acceptable. Show the interface as it is, you have nothing to be ashamed of, or implement the one you fantasise in the videos.
  22. I am now using the A4 tablet (I must replace the pen for the other), nevertheless: Not quite the whole arm, but quite a bit of it. You can imagine the surface taken by an A3 sheet.
×
×
  • Create New...