Jump to content

Hippocode

Member
  • Posts

    796
  • Joined

  • Last visited

Everything posted by Hippocode

  1. I never used these in VS. Maybe it's not exposed to VS and only available in the SDK.
  2. If you ever run into limits you might look at User Data, but I believe it's SDK only. Still you could write a VS function to handle your implementation. Basically you can attach (structures of) data to any object handle which is very cool. I have a junction object that can have unlimited legs, each leg info is dynamically added to the object handle without using a record. If all you are saving are coordinates you might also consider dynamic controlpoints and or the combination with above. This also opens the option of simply moving any of those points if the control handle is visible end enabled.
  3. I did not test the size limit but have you considered user data instead ?
  4. I believe even with VS you can choose to have plug-ins recalculate themselves whenever someone prints. Could this be a solution ?
  5. I just checked, the 2017 lib will be around 22ish. You could move them away as the 2016 plug-in won't work in 2017 and the library will be refreshed anyway when you get to use the 2017 version. You can still copy over stuff afterwards. As a sidenote, I don't have this issue. Maybe this is caused by having 2016 files inside the 2017 folder? You could have a look into that direction and see if converting all files fixes the popup. Just a thought.
  6. Not with VS directly, you can with the SDK. On the other hand, there could be a small workaround. Remember that saved views can have scripts assigned ? Well in there you can fake this event, find your object type in the layers that have been made active and do your thing. This would only work if you use your saved view to navigate to this layer. Could you explain a bit more of what you are trying to achieve ?
  7. I'm not actively using marionette but isn't there a magnitude node present in the default nodes folder under "math" ? I would be surprised if there isn't as this is a really basic math function. As a general rule, I wouldn't create and delete objects for the sake of calculating something. You might even run into objects being restated when you undo one step and this isn't a performance friendly solution. Magnitude |v| = √( x2 + y2 + z2 ) The magnitude is calculated with the vector between your two points, being v2-v1.
  8. A bug or not, it's never a good idea to have a parameter contain a special character. Since you can localise a parameter, have you tried that instead ? This makes the original name of the param "PARAM" and then you localise it in anything you'd like "PARAM's" When working (codewise) with the value you need the first one, the second one is only used when displaying to the end user in the OIP.
  9. From what I've seen myself trying out the plug-in I believe you are correct. You even get the same behaviour when you edit the crop, your plug-in is always one step behind. Assuming your findings are correct, you need an additional reset of the parent object, the viewport in this case: Add a hidden parameter to your object, BOOLEAN default to FALSE. Whenever your code runs, load the value. If it's 0 make it 1 and call a RESET to the parent object if it is a viewport. This will cause an additional reset of your object. Since the value now is 1, make it zero again but don't reset the parent object or you end up in an endless loop. In short, the viewport resets your object for the first time. Now your frame is at the wrong position. You then call a reset on the viewport. If lucky, the viewport now did recalculate it's other group properly. The second reset of your object now draws correctly and stops the loop. This is far from ideal and there are other/better ways of doing this but I don't think such functionality is available for VS.
  10. Hi Have a look at this page which clearly describes the difference between a "vector" and other variable types. http://www.vectorlab.info/index.php?title=About_Math_in_Vectorscript
  11. Have you considered a 3D polygon instead ? You can just draw the centerline/invert of your pipe that way. Say locus one (v0) and locus two (v1) The vector between them is U=v1-v0. The magnitude of U is the length of that segment. The angle depends by which axis but the slope can be calculated by comparing the dz(v1.z-v0.z) with the length. Since you are interested in pipes, we have some improvements coming for our mechanical plug-ins in 2017. All these parameters from the OIP can be shown by tags on the drawing and they update whenever you move the component as well.
  12. When you assign a class by script I don't think the object is "redrawn". Try resetting each object after you change the class.
  13. The function reference always clearly explains which variables it takes and which it returns. You can get a handle to your object using GetCustomObjectInfo. Look it up on the function reference as it returns multiple parameters. You'll see I also use that function in the example I've sent you.
  14. I think you are mixing up the part 'tool' and 'parametric object'. As I've said earlier, when you create an object with the VS editor you choose a type and it will automatically bind the tool for it. You don't need to alter the tool as it will work just like that. The tool will, once completed, create an instance of your object and insert the path you just created. It is your task to have your object load that path, and use it to draw something. Easiest way is to duplicate the path and use that as a base for your extrude. You can retrieve parameter values by preceding them with a P. Parameters itself are added uding the editor. I'll mail some sample code of an old path based plug-in. The 2017 version of my module will have a partially open source SDK project available to extend/tweak my module. Very cool, be sure to look at it. Sounds great, always welcome
  15. Lucky you it works the other way around. If you create a plug-in you have to choose a standard tool that will be assigned to it. When you create the plug-in in the editor you can choose the path type (2D or 3D) and boom your tool is ready. ( assuming you don't want any special stuff) Just make sure that your plug-in draws something based on the path of the object. The tool will create the path for you. I never customized tools using VS myself, only using the SDK. No samples to give
  16. It returns 1 because you have the viewport selected. From what you describe I'd say it doesn't return selected objects inside that container. When using a foreachobject loop you could define how deep the search has to look but that would traverse everything in the drawing. Look at http://developer.vectorworks.net/index.php/VS:GetVPGroup to get a handle to the annotations group, then traverse the group and find all selected objects. I believe that's the easiest way.
  17. Yes Simcity. "Invested" so many hours playing that game in the past.
  18. Since its based on pascal I'd think Exit should work ? http://www.freepascal.org/docs-html/rtl/system/exit.html could it be that you tried to call it nested which requires a number if you want to exit parent subroutines as well?
  19. Interesting object I believe you forget some settings as mentioned on this page: http://developer.vectorworks.net/index.php/VS:Parametric_State_Notifications Also make sure that the object is event enabled.
  20. While you can probably divide a vector it won't give you the expected result. Calculate the unit vector (direction) and the magnitude of the original vector. Then any point along the vector = original point + direction * magnitude / divider.
  21. http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/
  22. I don't see the issue but I suggest you just debug the script. Use some alert dialogs to see why and when Zael reaches above the array size.
  23. This is a common error when you try to acces an array item that's not there. numsel := Count((SEL=TRUE)); ALLOCATE SObjectHandle[1..numsel]; zaehl := 1; WHILE (objectH <> NIL) DO BEGIN SObjectHandle[zaehl] := objectH; zaehl := zaehl+1; objectH := NextSObj(objectH); END; Notice that you define your counter "zaehl " as 1, without checking there is atleast one object selected. You try to acces SObjectHandle[1] in a situation where it's not declared (numsel being 0). I've also had some weird behavior with dynamic arrays in the past, where I had to declare them size+1 to work in some special cases but I don't think that's the issue now.
×
×
  • Create New...