Jump to content

Dieter @ DWorks

Member
  • Posts

    2,825
  • Joined

  • Last visited

Everything posted by Dieter @ DWorks

  1. In the end, modelling is done to get drawings or other representations, like your videos. Not all details need to be there, just enough to have the intention clear. I also don't draw anymore, but I extract the drawings from the model...
  2. But why all the details. In most cases, it isn't needed. Drawings are mere representations you know.
  3. @digitalmechanics: I really like your signature: You can't measure all things, so this means that there are many things that can't be managed, like writing software etc.... At some level, I think it's totally true, but it doesn't always need to be measured. Working agile remove this need, and you end up with a much better product/result which the client really wants, + the client decides when it's finished.
  4. Aha, changes.... Some never request changes, others change 10 times. The 24 hours I am speaking of is a single whole design. Changes are done after that if needed, they are hard to estimate.
  5. I want to state something else, which each developer of plug-ins should keep in mind, as it's real: When you develop plug-ins for an application, you will need to live with it that in some future version, the functionality you have written could be in the core application. @Adrian: That's why I first commented on your post, because just having the function reference functions as nodes is something I see released in the near future, like Marissa stated. There's nothing wrong with you selling them, and please don't apologise for it. Just know that when some of those come available for free, you have to transfer them to a free package, or remove them. So keep on creating nodes, but try to create nodes that do compound things, or whole objects, like your arches. The added value you can offer is important for people purchasing stuff.
  6. ??? You really mean that you model everything by hand then and not using any of the available BIM objects in VW? 100 hours is so much. I know when you first start with drawing everything in 3D, at first you'll do quite a long time for it, but once you get the hang of it, it goes faster. I don't draw that much anymore, but when I stopped drawing everyday, I ended with 2-3 days for a complete design/application, fully 3D, that's 24 hours, includes renderings of the interiors too, though with generic furniture. This short time is also the result of a great setup of classes/layers and a huge library of everything I needed. These last resources are invaluable to draw quick and get good results, and yes, you'll put a lot of time in them, but you can build it project by project. I always added some extra stuff with each project, and that way, the time got shorter. But 100 hours? I don't know what projects you do, but imho, that's too much. Also, it depends on the type of project of course.
  7. @ahedley, keep doing this! VW really needs more great content. As a (FE) programmer myself, I'm not really into visual programming, and because there is a lack of great content (plugins) for VW, and it's not made easy to create them, I started DLibrary (https://bitbucket.org/dieterdworks/vw-dlibrary), to help others create plugins much easier with python. So you keep working on those Marionette nodes, I'll keep making the python side better
  8. Always there to help with all your questions regarding python!
  9. Hi, While going through the list of nodes, I noticed that this is only a 'translation' of vs functions. Why if I may ask? I was expecting more advanced stuff in the sense that for example some functions are being combined into one node where the user can specify the stuff more easily and use the same node for different kind of stuff. Like for example RRectangle and RRectangleN, These really could be in one node, making it easier for the user to use them, as they don't have to know the difference and can just use them. Marionette is meant to give users with no programming experience an interface to program stuff in VW. Many functions can't be used for that. Please keep in mind that this is constructive feedback.
  10. Ow, you are mixing vs with python? Never done that. I use pure python. I really can't answer that question. Why are you mixing the two? Is there any reason behind this? I think it's better to go with one of the two.
  11. There is only one proper way to encrypt your plugin, without others to reverse the process: Copy your imports into the plugin inside Vectorworks, then encrypt it, with the xml file present. That's why I only use one py file for the plugin. All the other things comes from libraries.
  12. Have you already tried vs.Chr(38)? As it's VS specific, I guess it will be escaped like vs expect it.
  13. Have you tried escaping it? like '\&' + 'The rest of the string.' I have never had this, so I don't know if that's the issue here. TIP: In Python, it's better/easier/more readable to use string format: 'This is my string: %s & %s' % ('My String', MyObject) Where %s will be replaced by the string representation of the things inside the tuple.
  14. Well, I absolutely love IntelliJ IDEA to work with, but it's not only Python oriented. I use this because I also do a lot of other programming work. You could use PyCharm (https://www.jetbrains.com/pycharm/), which is from the same vendor, and they have a community edition which should include all the things you need to write plugins for Vectorworks. There's also a remote debugger included, so you'll be able to debug your scripts in Vectorworks, which is really handy! Also, you could try my library DLibrary (https://bitbucket.org/dieterdworks/vw-dlibrary), which is meant to make plugin development way easier, though it's still from finished. If there are things not in it that you need, you can always request it, or you could add it yourself, I'll even help with that. It should take away the strange things from VS and enable you to work more OO. There aren't many example right now, but I'm working on it.
  15. Hi MaxStudio. I think you are fairly new to Python and programming in general? You are doing some strange things in your code and I think it's because of the lack of knowledge about OOP (Object Oriented Programming) and lack of the Python peps, which are rules on how to do your code. I think it's best to get that right first. So here are some tips I can give you based on your latest example: - A class in Python 3 should at least inherit from object, so that it's a real OO class. Plus a class name should be PascalCase: class MyClass(object): pass - A method in a class can be of one of three types of methods: A static method, a class method or an instance method. As you are making an instance of your class, and calling the method on that instance, I presume you want an instance method. This is created like the example below. Also, method names are all lower-case with underscore between the words. def run_me(self): vs.AlrtDialog('Hello world.') You see, instance methods always have a first argument of self. Python then know this method is an instance method. - Now I see you do obj = myclass, which is actually not creating an instance of your class, but saying that obj is your class. To create an instance of the class, you do: obj = MyClass() - In your previous examples, you had a return statement and after that a vs.Message call. This last call will never be reached, as return means to finish the current definition (method) and return whatever you put behind the return keyword. So that was why you never saw that message. - Now your initial question was about importing stuff, well, a good IDE will help you with that, so that when using stuff from other packages/modules, it will ask you to import it. Using a good IDE will help you in all these things, as they will mark mistakes are violations to the Python PEPs. This will help you code better, and also learn new stuff, as some IDEs will tell you possible solutions to violations, or even suggest better alternatives to code that is correct, but can be better. I hope I could help you with this, and if there are any further questions, just ask.
  16. Subject says it all. I can't do this now, even when setting the texture by object, I can only say what texture, but can't map it.
  17. Probably because classes and layers are in another internal list. Layers have their own internal list, classes and all other objects are in the 'main' object list. What you could do is first find all layers, filter out those that doesn't fit your search criteria, then create your search criteria based on that and then do the selection. I know this will be more work...
  18. Here is the code like I would have created it in VS: Your probably want to copy paste this in you ide, as these code boxes can't get wide enough. (Notepad++ is great for vs scripts, as you can set the language to Pascal to get colors and have your code much more readable. {// Use all-upper for reserved words, so your code is more readable.} PROCEDURE Main; {// Use constants for id's and predefined stuff, so you can change them later more easily.} {// Plus your code will be more readable, as a text says more than a number.} CONST isDataTypeLabel = 4; isDataTypeField = 5; dataTypeLabel = 7; dataTypeField = 8; labelWidth = 20; fieldWidth = 20; {// Begin your vars with a lowercase character, so you can see in code that it's a VAR and not a FUNCTION/PROCEDURE.} VAR dialogId : LONGINT; dialogResult: LONGINT; isDataType: BOOLEAN; gridType : STRING; oldType : STRING; PROCEDURE CreateControlsOnDialog; BEGIN AlrtDialog('Dialog creation is being run...'); CreateStaticText(dialogId, isDataTypeLabel, 'Data Type: ', labelWidth); CreateCheckBox(dialogId, isDataTypeField, ' A'); CreateStaticText(dialogId, dataTypeLabel, 'Reference: ', labelWidth); CreateEditText(dialogId, dataTypeField, oldType, fieldWidth); SetFirstLayoutItem(dialogId, isDataTypeLabel); SetRightItem(dialogId, isDataTypeLabel, isDataTypeField, 0, 0); SetBelowItem(dialogId, isDataTypeLabel, dataTypeLabel, 0, 1); SetRightItem(dialogId, dataTypeLabel, dataTypeField, 0, 0); END; PROCEDURE DialogEvents(VAR item, data : LONGINT); PROCEDURE SetupEvent; BEGIN {// Here you setup your controls, like doing all setters so that the data really is in there.} {// Be aware that some controls, even though you can define the default value on creation,} {// will not actually has this value when you do the getter, so therefore you have to use setter here.} {// Also populating dropdowns etc.. happens here.} END; PROCEDURE OkEvent; BEGIN {// Ok event will happen before the dialog closes, so here you can get all values from the controls} {// and put it into your variables, so you can use it after the dialog has been closed.} GetBooleanitem(dialogId, isDataTypeField, isDataType); GetitemText(dialogId, dataTypeField, gridType); UprString(gridType); AlrtDialog(Concat('Ok event has been done, we got gridType: ', gridType)); END; PROCEDURE CancelEvent; BEGIN {// Cancel event also will happen before the dialog closes. You can do stuff here if you want,} {// but most of the time you won't need this, unless you want to reset some variables.} END; BEGIN AlrtDialog(Concat('A dialog event is started for item: ', Num2StrF(item))); {// Each control will throw an event with it's id for the item, so if you want to react to a change} {// of one of your controls, you can do that. In this case the data can hold extra info on what} {// exactly has happened to the control, like deletion of an item in a list box etc...} CASE item OF SetupDialogC: SetupEvent; 01: OkEvent; 02: CancelEvent; END; AlrtDialog(Concat('The end of dialog event for item: ', Num2StrF(item))); END; BEGIN {// Setting the initial values of our parameters. You should do this in another procedure} {// But we only have one now, so I'll leave it here.} oldType := 'AA'; {// The following will create a dialog canvas we can use to put our dialog controls on.} dialogId := CreateLayout('Data', FALSE, 'isDataType', 'Cancel'); {// We then can populate the dialog with controls.} CreateControlsOnDialog; {// Then if the dialog layout is ok for VW, we run the dialog and get back how it was closed.} IF (VerifyLayout(dialogId)) THEN BEGIN dialogResult := RunLayoutDialog(dialogId, DialogEvents); {// You can now act based on the result of the dialog (ok or cancel was clicked).} END; END; run (Main); Keep in mind that each one has his own personal style, but there are some 'rules' most of us use to have code more readable. VS hasn't any code styling rules, but other programming languages have, like Python, and they really help structuring code and make it readable.
  19. I find a lot on http://developer.vectorworks.net, and many things I also had to find out by trying/debugging, and from others that helped me. Also one of the reasons I started DLibrary, so people who are just starting out creating plugins can get into it more easily.
  20. I always leave it like it is, but I draw the roof in two pieces, one is the planes you see on your floor plan, and on another layer are the planes you don't see there, then it's all you want. Nowadays, I also use the autohybrid when I draw the whole roof manually, then you can do the same.
  21. I'd like the following usage: - select the tool - hover over the drawing with the cursor - VW should highlight the graphic elements while I hover (could be everything - not necessarily a custom object) - I click one one of the graphic elements while it is highlighted - my plugin object retrieves information of that element and my object is placed right there where I clicked - the plugin object shows information of the element like a stamp (for example the area of the element) And yes: maybe it's more like a custom tool than a custom plugin object. Do you think, I can succeed by making a tool rather than a plugin object? Yes, you will need both a custom tool and a custom object. The custom tool will let the user select the object where you want the info from, then create the custom object and set the parameters based on the selection. I'm sure there are calls for you to let the user choose something, and they will highlight the objects the user hovers, as this is default VW behaviour.
×
×
  • Create New...