Jump to content

Kars Keizer

Member
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Kars Keizer

  • Rank
    Greenhorn

Personal Information

  • Occupation
    Technical drawer @ the Inside standbuilding
  • Homepage
    Karskeizer.nl
  • Hobbies
    Design/crafts
  • Location
    Netherlands
  1. Got what i wanted by first making an viewport and then exporting this viewport as an image, By doing it this way i can use every render style and it will have no problems updating The two time changing the render style and updating is because other wise the viewport will show an red cross. (don't no why but is working now) _dLayername='Render' _pLayername='Render2' _dRenderlayer=vs.CreateLayer(_dLayername, 1) _pLayername=vs.CreateLayer(_pLayername, 2) _hViewport1=vs.CreateVP(_pLayername) _nClass=vs.ActiveClass() vs.SetObjectVariableInt(_hViewport1, 1001, 0)#Renderstyle Wireframe vs.SetVPLayerVisibility(_hViewport1, _dRenderlayer, 0)#set Layer visible in VP vs.SetVPClassVisibility(_hViewport1, _nClass, 0)#set class visible in VP vs.SetObjectVariableInt(_hViewport1, 1000, 0)#Orthogonaal vs.SetObjectVariableInt(_hViewport1, 1007, 9)#view vs.UpdateVP(_hViewport1) vs.SetObjectVariableInt(_hViewport1, 1001, 11)#Renderstyle OpenGL vs.UpdateVP(_hViewport1) vs.Ungroup(vs.SymbolToGroup(_hViewport1, 0)) _hImage = vs.LSActLayer() _ImageType = vs.GetObjectVariableLongInt(_hImage, 532) if _ImageType == 1: ext = '.jpg' else: ext = '.png' _fileName = _RenderFolder +'\\' + _nSymbol + ext vs.ExportImageFile(_hImage, _fileName) _hlayer1=vs.FLayer() _nlayer1=vs.GetLName(_hlayer1) vs.Layer(_nlayer1) _hRenderlayer=vs.GetLayerByName(_dLayername) vs.DelObject(_hRenderlayer) _hRenderlayer=vs.GetLayerByName(_pLayername) vs.DelObject(_hRenderlayer)
  2. Got what i wanted by first making an viewport and then exporting this viewport as an image, By doing it this way i can use every render style and it will have no problems updating The two time changing the render style and updating is because other wise the viewport will show an red cross. (don't no why but is working now) _dLayername='Render' _pLayername='Render2' _dRenderlayer=vs.CreateLayer(_dLayername, 1) _pLayername=vs.CreateLayer(_pLayername, 2) _hViewport1=vs.CreateVP(_pLayername) _nClass=vs.ActiveClass() vs.SetObjectVariableInt(_hViewport1, 1001, 0)#Renderstyle can not be Wireframe vs.SetVPLayerVisibility(_hViewport1, _dRenderlayer, 0)#set Layer visible in VP vs.SetVPClassVisibility(_hViewport1, _nClass, 0)#set class visible in VP vs.SetObjectVariableInt(_hViewport1, 1000, 0)#Orthogonaal vs.SetObjectVariableInt(_hViewport1, 1007, 9)#view vs.UpdateVP(_hViewport1) vs.SetObjectVariableInt(_hViewport1, 1001, 11)#Renderstyle OpenGL vs.UpdateVP(_hViewport1) vs.Ungroup(vs.SymbolToGroup(_hViewport1, 0)) _hImage = vs.LSActLayer() _ImageType = vs.GetObjectVariableLongInt(_hImage, 532) if _ImageType == 1: ext = '.jpg' else: ext = '.png' _fileName = _RenderFolder +'\\' + _nSymbol + ext vs.ExportImageFile(_hImage, _fileName) _hlayer1=vs.FLayer() _nlayer1=vs.GetLName(_hlayer1) vs.Layer(_nlayer1) _hRenderlayer=vs.GetLayerByName(_dLayername) vs.DelObject(_hRenderlayer) _hRenderlayer=vs.GetLayerByName(_pLayername) vs.DelObject(_hRenderlayer)
  3. Solved this one, instead of _hImage=vs.LNewObj() I had to use _hImage = vs.LSActLayer()
  4. @MullinRJ I see, when I wrote the code i saw this comment in the remarks Following this remark i got this list of constants which i noticed were correct. so the list in the appendix is not correct I think. But this is not what is causing the problem.
  5. I'm writing an script that will take each symbol(_i in list of symbols) from the resource folder makes an render and places it in an folder. for _i in _lSymbols: _Renderlayer=vs.Layer('Render') _hRenderlayer=vs.ActLayer() vs.Symbol(_i,0,0,0) vs.DoMenuTextByName('Standard Views',8) vs.DoMenuTextByName('Fit To Objects', 0) vs.SetLayerRenderMode(_hRenderlayer, 6, True, True) vs.DoMenuTextByName('Copy',0) vs.DeleteObjs() vs.DoMenuTextByName('Paste As Picture',0) _hImage=vs.LNewObj() _iRenderFolder=_RenderFolder+ '\\' +_i+'.png' vs.ExportImageFile(_hImage,_iRenderFolder) vs.DeleteObjs() One problem i encountered is that when i set the render mode as "Final Quality Renderworks" (14) or "openGL" (11) it will produce an white square with "paste as picture". so whit this script I'm limited to using modes as "FinalHiddenLine"(6) Also my "vs.ExportImageFile" is not working at the moment. Can Anyone give some tip ore advise on this script or how the get an similar result using other functions. I also looked into using vs.DoMenuTextByName('Export Image File') but this wil give an dialog for the user and I'm trying to limit/eliminate all user interaction. See also my other topic on an small part of this script
  6. I'm writing an Python script with this part in it: vs.DoMenuTextByName('Standard Views',8) vs.DoMenuTextByName('Fit To Objects', 0) vs.SetLayerRenderMode(_hRenderlayer, 6, True, True) Now i have the problem that the script gives the order to set the view and zoom and VectorWorks will do this , but when the script is ordering to set the rendermode VW is still busy setting the zoom and view and will skip this step. If i run this script again without changing my zoom and view it will set the render mode correct because then VW can skip zoom and view and is ready when it gets the order to change the rendermode. I Think the issue is probably that VW is visually showing the zoom an view change and that takes time. To set the rendermode first is not working because it will change back to wireframe when the zoom/view is changed. I also tried the function vs.Wait() but this is not making any difference except the script takes longer to run. Has someone an idea to overcome this?
  7. got it, i got rid of the whole marionette thing and started scripting in python, with some help from designexpress (dutch vectorworks suplier) and som self studing i created this script. SymbolData.zip
  8. Got some progress, the only thing is i have to place the symbols in the design layer first (Credits to @DomC for the symbols node where i used one of his nodes as base) Sjabloon Bibliotheek.vwx
  9. Hope I'm not trying something to difficult, Started with marionette an few months ago, but I'm an fast learner with experience in multiple CAD programs. (could work with VW without problems within an month)
  10. I'm trying to manage the shared recourse manager at my company. In the library and on the internet I can hardly find nodes to interact with the recourse manager instead of the design layer. For example whit "objs by crit" I can only select symbols that are place in the design layer. Am i missing something or does someone has nodes i can use. What I'm planning to do: with the programme we use for managing our stock we can get an excel file with art. numbers, description, amounts and dimensions. when we make an new article/symbol and we place it in the resource manager, I want to make an script that checks the name of the symbol (which we will give manually by using the article number) When it recognises the symbol name(Art. number) it wil changes its name in art. number+description. also the extra information will be put in an record attached to the symbol. Problems(challenges) I'm facing so far: obj name and symbol name are different things. missing a node to get symbol name. attaching record is only attaching it to the symbol as object and not to the symbol itself, so when i put information in the record it doesn't change copies of this symbol. A node of some kind to get an list of symbols in the resource manager. No node of some kind to change a symbol name. I already started rewrite code's of some nodes to make them do what i want, but still learning and not much experience with python.

 

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.

×
×
  • Create New...