Jump to content

avictorgm

Member
  • Posts

    34
  • Joined

  • Last visited

Everything posted by avictorgm

  1. 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?
  2. 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
  3. 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?
  4. 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 ?
  5. thanks for the help, still don't get it. but I am not giving up. Just focus in something more urgent.
  6. 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);
  7. 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
  8. 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?
×
×
  • Create New...