Jump to content

Musisback

Member
  • Posts

    154
  • Joined

  • Last visited

Everything posted by Musisback

  1. I found it : gSDK->CreateOffsetObjectHandle works fine. Sorry to have bothered you with this post. Regards,
  2. Hello, I am looking for an equivalent in the SDK of the vectorscript function OffsetPoly that works on 2D polylines. VS:OffsetPoly works on polygones and polylines just as the offset tool : but can be used in plugin objects. I tried GetOffsetRingPoly of the VWPolygon2D class but it return a polygone, not a polyline. Any ideas ?
  3. Well, it works, but it is quite tricky because the duplicate doesn't have a name after duplication... Here's how I do : function duplicateClass(className : string) : string; Const ProvName = '###NewClass###'; VAR newClass, class2duplicate : handle; BEGIN class2duplicate := Getobject(className); newClass := CreateDuplicateObject( class2duplicate,getparent(class2duplicate)); SetName(newclass,ProvName); RenameClass(ProvName ,className); duplicateClass := Getname(newClass); END;
  4. Hello, I use external packages in python. I'm wondering what's the best way to distribute them to the plug-ins users. It's apparently bad to place them in the plug-ins folder because Vectorworks goes through all the subfolders of "Plug-ins" at startup looking for plug-ins files I think I could create a Python folder in the user application folder. Do you think it can be damaging to the application to have an extra folder full of subfolders in the user's application folder (next to Plug-ins, Libraries, Workspaces, ...) ? Do you have better ways to distribute external python packages ? Thank you, Regards,
  5. I have the exact same problem... No solution found yet, sorry...
  6. Hello, The python interpreter of Vectorworks automatically generates .pyc files in a __pycache__ folder. It does it if the plugin is encrypted (obfuscated) or if it's not. On the other hand, it seems quite easy to uncompile .pyc files : http://stackoverflow.com/questions/5287253/is-it-possible-to-decompile-a-compiled-pyc-file-into-a-py-file) Does that mean that it is not possible to properly protect our source code? Wouldn't that be easier to simply distribute the .pyc instead of the encrypted vso/vst/vsm file ? Common .py files would not need to be packed up in each plugin file and the plugins would therefore be lighter...
  7. I use a different approach to solve this issue. I created a command that clears all the modules in a designated folder. (In the example : myLibrary) It actually removes the modules from sys.modules. Python will therefor import them again at the next import statement. I find this much easier than placing "reload(module)" statements everywhere in my code. (especially since they need to be removed for deployment) import sys modulesToDelete = [] for m in sys.modules: moduleName = str(m) if "myLibrary." in moduleName: modulesToDelete.append(moduleName) currentModule = __name__ for mod in modulesToDelete: if mod != currentModule: # Python cannot delete the current module del sys.modules[mod]
  8. Hello, Is it possible to duplicate a class via Vectorscript? Thanks
  9. Awesome ! It works... It's weird because the VectorScript Function Reference guide says for the function "BuildResourceList" Well, I'm glad it is fault.
  10. Hello, I use resources from an external file in a PIO dialog thumbnails popup control. ( ex : wooden panels textures). I don?t want other texture ( from the current file but not from the external file) to appear on top of the list. I could erase some textures but I cannot make the difference between the resources that are in my current file and also in the external file (previously imported) and the resource that are in my current file but not in my external file. Any Idea ? Damien
  11. You have to display a new updated dialog. I had a similar problem. See this thread: http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Main=35278&Number=173908#Post173908
  12. Hello, Is it possible to build a resource list with only a part of the symbol definitions of the external file. (For instance, only one symbol folder.) I actually want some symbols to appear in my dialog box but not all of them. I cannot move the others in another file because they are sub-parts of the main symbols. VectorScript Function Reference says for VS:BuildResourceList: But it doesn't seem to be true. All symbols appears for me. Thanks,
  13. Here is how I did it : BeginPoly3D; Add3DPt(TopPt.X,TopPt.Y,TopPt.Z); Add3DPt(TopPt.X,TopPt.Y,TopPt.Z -1 ); EndPoly3D; getBBox(lnewobj,pt2D.X,pt2D.Y,pt2DBis.X,pt2DBis.Y); DelObject(lnewobj); Its pretty ugly but it works. If someone has better, I'd be glad to read it...
  14. Thanks but it seems to be for 2D points not 3D... I'd like to get the screen coordinates of 3D points, whatever the 3D view is.
  15. It is maybe because your plugins files are located in the program files folder instead of the user folder (appdata)...
  16. Do you know how to convert 3D coordinate into screen coordinate? Thanks;
  17. Thanks that will help a lot. Also, is it possible to import a new version of a resource to the current file with out getting the "replace resource" dialogue? if I erase it prior importing, it will be erased of my drawing...
  18. Hello, I use external resources in my PIO's. (texture's, records format & symbols) To make the PIO's works better, I only import them when they are missing from the current file. What I would like to do, is checking if the resource in the external resource file is the same that the one it the current file. This way, I could reimport out of date resources in projects that were started long ago when the resources where different. VW checks if the external resource is the same as the local one all the time. For example : -if you import a external symbol, it will display the "replace resource dialog" only in there is a difference between the local and external symbol. - in a resource popup window (e.g. textures popup) the resource is only displayed twice if the local and the external version are not the same... In short : How to do this check myself?
  19. EAP:= createcustomObjectPath('Extrude Along path',pathHd,ProfileHD); works also. Its much easier to use I think... Just make sure both poathHD and rofileHD are NURBS
  20. I think that would be the best ways if a direct access in not possible. Exporting default values from one up to date file then importing them in the out of date file...
  21. I have a new version of my PIO's and some default parameters have changed. The default parameters are set in the template my users use. So with the update of the plug-ins I am going to distribute a new template. The problem is that some older files might produce weird results with the new plug-ins. So I'm thinking of doing an update script to set the new default in older files. I could 'hard code' the default in my script, but I would prefer to be able to read the real default parameters. (the ones set in the plug-ins editor, not the default in the current file.)
  22. If it is about sharing data, then the easiest way might be to just share data. Let me explain : You can give a name to your Master object. if getname(objhd)='' then setname(objHd,CreateUUID); and store the master name in one of the slave PIO parameters. then you can get all you need in the slave PIO directly from the master. MasterHd := GetObject(PMasterName); AnyParam:=GetRField(MasterHd,GetName(GetRecord(MasterHd,1)),'AnyParam'); On the other hand, you can store the Slave's name in the Master PIO so it can access the slave's info (Path area for instance)
  23. I don't exactly understand what you mean. What you can certainly NOT do is a PIO on 2 layers at once. What you could do is having a slave PIO that is on another layer than his master PIO and that set its position from the master's. When the master moves, on the other hand, it could reset the slave PIO. This last one is therefore always placed from the master's location... I hope this helps. If it does, I can explain more.
  24. Ok, that works great. But I now need to access real default parameters of my PIO's. The ones set is the Plug-in editor not the ones stored in the VW file. I could erase the PIO record definition (Delobject(GetObject(kObjectName)) and create a new one tmpHan:=CreateCustomObjectN(kObjectName, 0, 0, 0, FALSE); DelObject(tmpHan); But then, all the PIO's present on the drawing become useless (Broken) You have another way?
  25. Well that's interesting because : (* Comments *) works also. I found this in the VS language guide and I used it lots of times.
×
×
  • Create New...