Jump to content

Musisback

Member
  • Content Count

    154
  • Joined

  • Last visited

Everything posted by Musisback

  1. Musisback

    SDK Equivalent of VS:OffsetPoly

    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 ?
  2. Musisback

    SDK Equivalent of VS:OffsetPoly

    I found it : gSDK->CreateOffsetObjectHandle works fine. Sorry to have bothered you with this post. Regards,
  3. Musisback

    Duplicate Class

    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. Musisback

    Duplicate Class

    Hello, Is it possible to duplicate a class via Vectorscript? Thanks
  5. Musisback

    External Python Packages

    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,
  6. Musisback

    Python-Aptana-DeveloperWiki

    I have the exact same problem... No solution found yet, sorry...
  7. Musisback

    Problems Encrypting a Python Script

    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...
  8. Musisback

    Can we disable Python caching?

    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]
  9. Musisback

    How to get the Name Of A PIO?

    I can't find the function that gives the name of a PIO. I mean by name, the type of PIO and not the data name that the function getname(H : handle) returns. Thanks,
  10. Musisback

    symbol price with ODBC

    I would like to connect symbols to a record kept up to date with ODBC. To connect a symbol definition to a record. I need to enter the definition, deselect everything and choose the record. If I want to set a database line for this symbol : Tools > Database > Object connection. Well there is a problem, Nothing is selected, so it doesn't work... So, how can we connect a symbol definition to a database line?? Thanks,
  11. 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
  12. Awesome ! It works... It's weird because the VectorScript Function Reference guide says for the function "BuildResourceList" Well, I'm glad it is fault.
  13. Musisback

    Change dialog layout trough a dialog event

    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
  14. 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,
  15. Musisback

    Get Screen Plan coordinates of a 3D point

    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...
  16. Do you know how to convert 3D coordinate into screen coordinate? Thanks;
  17. Musisback

    Get Screen Plan coordinates of a 3D point

    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.
  18. Musisback

    Plug-in script edits not saved

    It is maybe because your plugins files are located in the program files folder instead of the user folder (appdata)...
  19. 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?
  20. Musisback

    Checking resources up to date status.

    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...
  21. Musisback

    CreateExtrudeAlongPath

    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
  22. The default values of the parameters of a PIO are defined by the plug-ins editor. The first time the PIO is used in an file, we get the opportunity to set other values ( Object Properties dialog). If the same files is used as template, the Object Properties dialog will not appear at the first use of the PIO because the default value are stored in the template. We can still change those values by clicking on the Object Properties button of the PIO. So far, everything is OK. Now here is my questions : Can we change those values from script ? I actually would want the users of my plug-ins to be able to set different defaults to draw different type of things within the same template.
  23. Musisback

    Change default PIO parameters from script.

    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...
  24. Musisback

    Change default PIO parameters from script.

    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.)
  25. Musisback

    Combined PIO

    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)

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×