Jump to content

avictorgm

Member
  • Content Count

    21
  • Joined

  • Last visited

Everything posted by avictorgm

  1. OK Forget it. I GOT it!! The problem comes with the value of Lasten---> you need to correct with : vs.Num2Str(decPlace, v) ----> vs.Num2Str(0, Lasten2)
  2. In other Topic you got me on the way to read the value of the databank of a symbol. Now the problem is exactly the contrary. I want to create a new symbol with 200 written in the textfield, but comes 60! Lasten = 200Kg the databank is named: "LOADS_DB" The field of the databank is named: "Lasten" but somehow that leaves another totally different number in the field Lasten---> 60 I feel the problem is in the last line of code. Any help? vs.SetRField(SYMBOLO2,'LOADS_DB','Lasten', vs.Num2StrF(Lasten2))
  3. At the end I GOT IT!!!! Took me a little, but after this a whole world of possibilities has opened to me! import vs #Vistor Garzon 2020 based on the work of # ©MaKro - June 2018 ;-) H1 = vs.FSActLayer() H2 = vs.ActSymDef(H1) recname = vs.GetName(H2) # Name of PIO in InfoPalette Rec_Name = vs.GetObject(recname) fld = vs.GetRField(H1,'loads-roof','Deckenlast') ##### vs.GetRField(h,'DatabankName','FieldName') vs.AlrtDialog(fld)
  4. the best software i know is Arcgis. Take a look here, the Database and reference of the TIFF files was made with QGIS, and the video edited and entirely made with ArcGIS. https://www.youtube.com/channel/UCARALX_xnppFaMKUYaKY9sA/videos Maybe Vectorworks Landmarkt would help you?
  5. You got a message! by the way, my email is avictorgm@gmail.com i am always reachable here.
  6. Hi, My Name: Victor My Skills: Python, Excel Makros, BIM expert... My experience: Besides, GIS and Statik Engineering--> 4 years Event engineering using spotlight Examples of my Scripts: 1) A script that substitute one specific symbol for a custom group of simbols depending of the position. 2) Another that check every layer looking for an specific symbol name to check how many exist in layers with specific names. On that way you avoid to add hundred exceptions to the Material List. 3) Another that creates several layout layers around the exact coordinates of an area. Each one with different selection of classes and layers. So, for example: the first has only the forest layers on, with classes of animals off. the second one can be the layers with the word "water" in the name. 4) Layer Creator, I mean, with one click you can create several layers with specific extension names based on the first given name/code. 5) Automatic measuring of simbols. very usefull if you have 50 simbols inside an area and have no time to loose clicking, and clicking, and clicking...
  7. That is pretty cool!! @MullinRJ So, whatever I do with the script, there´s no difference in the settings. This kind of details make the difference. Thank you
  8. Hello, No way to rename objects (rectangle or polygons) with: Even with 3D polygons the problem is the same. But If the element is a sphere it works. Why? vs.SetName() import vs ObjectName = vs.GetName(vs.FSActLayer()) vs.AlrtDialog(str(ObjectName)) SName = 'Fred' points = [0,0,-0.5,1,0.5,1.5,2,1,1,-0.5,0,0] h1 = vs.Poly(*points) vs.SetName(h1, SName) import vs X1 = 100 Y1 = 150 X2 = 0 Y2 = 500 NombreStand = 'Nombre' SName = vs.Concat(NombreStand) h = vs.Poly(0,0,X1,Y1,X2,Y2,0,0) h1 = vs.SetPolyClosed(h, 1) h2 = vs.MakePolygon(h1) vs.DSelectAll() vs.SetName(h2, SName) This one works perfect! import vs ObjectName = vs.GetName(vs.FSActLayer()) vs.AlrtDialog(str(ObjectName)) SName = 'Fred' h1 = vs.CreateSphere(0, 0, 0, 1000) vs.SetName(h1, SName) I am wondering if the problem is that are 2D elements, (that has no sense at all)
  9. Hello people, I just edit because I found this way. import vs import os Vendor = 'ACME' Price = 123.45 Tax = 1.07 fileName = 'Classes.txt' def Example(): vs.GetFile(fileName) if not vs.DidCancel(): vs.Rewrite(Vendor, 0) #vs.WriteBin(Vendor) #vs.WriteMac(Vendor) #vs.WriteLnMAC(Vendor) #vs.Write(Vendor) vs.Close(fileName) Example() But, the next attributes get this message: "AttributeError: module 'vs' has no attribute 'WriteBin'. " -vs.Write -vs.WriteLnMac -vs.WriteBin -vs.WriteMac With write I don't get error, but also no result. -vs.Rewrite
  10. If I use --> vs.FillBack(4) #number of color on the list of vectorworks = Blue before this vs.CreateText(... works perfect Thank you again @MullinRJ
  11. @MullinRJ ⬅️ GENIUS Thank you so much. You just save my day! vs.CreateText(str("Motor ") + str(X1) + str(", ") + str(Y1)) h = vs.LNewObj() # if you want to save the handle to the text object vs.SetFPat(h, 1) vs.PenBack((0, 36535, 0)) #RED
  12. import vs X1 = -3000 Y1 = -1500 vs.DSelectAll() vs.MoveTo(X1,Y1+18.5) #Move the pointer to vs.PenSize(10) #outside line of the box def Texto(): vs.TextRotate(271) vs.TextSize(12) vs.TextJust(1) #Left 1, Center 2, Right 3 vs.TextVerticalAlign(3) #Leading / space, Constant Single space 2 ,1 1/2 3 , Double space 4 #colorIndex = vs.RGBToColorIndex(1, 45, 23) #vs.TextBack(colorIndex) # using Color Index values #vs.OpacityN(100, 100) #vs.OpacityN(fillOpacity symbol include, penOpacity) #vs.PenSize(24) # DEFINIR GROSOR DE LINEA EXTERIOR DE RECTANGULO # 1 = 0,03 # X = 0,025 * X # 8 = 0,20 # 24 = 0,6 #vs.SetStaticTextStyle(3) vs.TextFont(vs.GetFontID('Times')) #vs.TextStyle(3) #vs.FillPat(1) #vs.FillBack(126) vs.PenPat(1) # Change for the document vs.FillBack(7) # Change background color for the document but not of the text vs.PenFore(120,0,0) #Change text color of fixed text to Purple vs.FillPat(53) vs.PenBack(0,255,0) #vs.FillPat(1) #vs.FillFore(0,0,255) # Blue Texto() h = vs.CreateText(str("Motor ") + str(X1) + str(", ") + str(Y1)) # -1 = linienart # 0 = linea invisible o vacia / Leer # 1 = solid # 2 = ? # 3 = muster / estampado # 4 = ? # 5 = ? #vs.PenFore(123) #vs.FillPat(53) # 0 = empty # 1 = solid # 2 = # x = count number in the table of examples # 21 = small squares #vs.Rect(X1+150,Y1+200,400,500) Hello I have tried many options to change the attributes of the static text to purple text and back color red. I got half, the text color. I can even change the color of the background of the document. But somehow the pattern of the background stays in empty option for the text. What small line of text am I missing?
  13. Hello again, I have. a code to go thru every element / symbol in my layer until it finds a rectangle. then, I just need to get selected only this element. A) I use X = 10 just to put a number. I need to count the number of elements. the script works well until B) where it doesn't get the rectangle to zoom it whit the next line Some ideas? import vs x = 10; #-A)----------I need to count the number of objects in the layer #vs.AlrtDialog(vs.Concat('Nr of objects is: ', ***Count of all the elements in the layer*** )) vs.DSelectAll vs.LActLayer() OBJETO = vs.LActLayer() SymbolName = vs.GetSymName(OBJETO) while x > 0: ElementTYPE = vs.GetType(OBJETO) if ElementTYPE == 15: SymbolName = vs.GetSymName(OBJETO) vs.AlrtDialog(vs.Concat(str(ElementTYPE), " Name: ", str(SymbolName))) #vs.AlrtDialog(vs.Concat('Object is a ', objectTypes[vs.GetType(h)])) if ElementTYPE == 3: vs.AlrtDialog(str('Recuadro encontrado')) vs.AlrtDialog(str(ElementTYPE)) #B).........I wanna set active the rectangle vs.GetObject() vs.DoMenuTextByName('Fit To Objects', 0); break OBJETO = vs.PrevObj(OBJETO) x = x - 1
  14. Hello everyone. I am trying to do something that looks easy but I don´t find the right functions: "To change the position of a design layer" The initial situation is this one: Design Layer # Design Layer A --> 1 Design Layer B --> 2 Design Layer D --> 3 I want the layers like this: Design Layer # Design Layer A --> 1 Design Layer B --> 2 Design Layer C --> 3 Design Layer D --> 4 Must be not so difficult to insert a new in a position because I can do manually when I create a new layer. I need to know how to get the number of the "Design Layer B" --> 2 And be able to create a new layer at the next number. this are my options, and no one is useful to my eyes vs.Layer("Design Layer B") vs.CreateLayer('NEW Design Layer', 1) vs.CreateLayer('NEW PRESENTATION Layer = LAYOUT', 2) Any idea?
  15. Hello again, I have 2 different named symbols every symbol is attached to his own databank with different names. when I replace the symbol both databank stays active in the Information window / Data. And I can write some numbers inside the 2 of them. Can somebody explain this ?
  16. thanks for the help, still don't get it. but I am not giving up. Just focus in something more urgent.
  17. Hello, I am glad that I can see some evolution in my skills. And thanks to this forum I can manage more tedious work easy and nice. In reward here is the first really useful script in vectorscript. It creates some layers all together with date and different text. I hope you enjoy. Notes: -If the layer exist give back an alert and do not create the layer. {/////////////////////////////////////////// CreateDifferentNewLayers V 1.3 with extra separation layer with date By Ing. Victor Garzon (2018) distribute freely avictorgm@gmail.com Using as codebase from Vectorworks: (c) 2001 Nemetschek North America. Distribute freely. ///////////////////////////////////////////} PROCEDURE CreateDifferentNewLayers; VAR newname : STRING; Rahmen : STRING; LayA : STRING; LayZERO : STRING; LayB : STRING; LayC : STRING; LayD : STRING; LayE : STRING; LayF : STRING; LayG : STRING; LayH : STRING; TextoAlert :STRING; Texto1 :STRING; Texto2 :STRING; ch : HANDLE; BEGIN Texto1:= 'The Layer for the Stand '; Texto2:= ' will be created at the top of the list'; newname:= StrDialog('Enter name of new layer:','Untitled Layer'); LayZERO:= Concat('-------', newname, Date(2,1), '--------------------'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayZERO); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayZERO, Texto2); Layer(LayZERO) END ELSE AlrtDialog('Layer Layers created already exists.'); LayH:= Concat(newname, '_8_Frei'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayH); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayH, Texto2); Layer(LayH) END ELSE AlrtDialog('Layer name already exists.'); LayG:= Concat(newname, '_7_Standfläche'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayG); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayG, Texto2); Layer(LayG) END ELSE AlrtDialog('Layer name already exists.'); LayF:= Concat(newname, '_6_Traversen'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayF); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayF, Texto2); Layer(LayF) END ELSE AlrtDialog('Layer name already exists.'); LayD:= Concat(newname, '_5_Lasten'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayD); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayD, Texto2); Layer(LayD) END ELSE AlrtDialog('Layer name already exists.'); LayE:= Concat(newname, '_4_Punkte'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayE); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayE, Texto2); Layer(LayE) END ELSE AlrtDialog('Layer name already exists.'); LayA:= Concat(newname, '_3_Maße_Lasten'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayA); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayA, Texto2); Layer(LayA) END ELSE AlrtDialog('Layer name already exists.'); LayB:= Concat(newname, '_2_Maße_Punkte'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayB); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayB, Texto2); Layer(LayB) END ELSE AlrtDialog('Layer name already exists.'); LayC:= Concat(newname, '_1_Maße_Träger'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayC); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayC, Texto2); Layer(LayC) END ELSE AlrtDialog('Layer name already exists.'); END; Run(CreateDifferentNewLayers);
  18. Thanks for the answer, Yes, it´s already done: I have a group of symbols already linked between the database and the field Deckenlast. I have found this on the web from Makro, but gave me back "0", "0" and " ", " " Some help? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - import vs hpio = vs.FSActLayer(). # this MUST give back the first element of the active layer, BUT I think is NOT. hrecdef = vs.GetParametricRecord(hpio). recname = vs.GetName(hrecdef) # Name of PIO in InfoPalette hrec = vs.GetObject(recname) fld = vs.GetFldName(hrec, 10). #. I AM NOT SURE ABOUT THIS 10 vs.AlrtDialog(vs.GetTypeN(hrecdef)) # 48. answer "0" vs.AlrtDialog(vs.GetTypeN(hrec)) # 47. answer "0" vs.AlrtDialog('Recordname:' + recname). #. answer " " vs.AlrtDialog('Default:' + vs.GetRField(hrec, recname, fld)). #. answer " " # ©MaKro - June 2018 😉 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vectorscript Symbol read.vwx
  19. Hello, I am kind of new on Python but not on Vectorworks. I have a custom symbol that contains 2 text labels: one contains a number like "2,43", the other is always the same text not attached to the database. I need to get read that "2,43" and later do the contrary: be able to write into the field in the symbol another number. some ideas?

 

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