Jump to content

The Hamma

Member
  • Posts

    251
  • Joined

  • Last visited

Everything posted by The Hamma

  1. I have a script that I’m working on and I would like to display the coordinates of points but when I try to convert the points to string it says it’s a tuple not a number. many ideas i tried: print(p1) and vs.num2str(p1)
  2. Updated to center symbols and added tag script. I updated the script to center the symbols and center the text on the symbol. Also I added a second script to use a record rather than the symbol name. You will have to assign the "Legend Record" to the symbol in the resource manager and give it a name in "Legend Text" Field. Record will be created on first run if it does not exist. Sample file attached. "Create Symbol Legend" script - uses Symbol Names """ This script inserts all of the symbols in the current drawing resource manager into the drawing with the symbol name. Symbol and text are in an individual group. Use the distribute command to space them evenly after creation. This Python Script may be freely distributed. No warranty provided. Use at your own risk. David Hamer, 2021 revision 09/30/2021 """ xP = yP = 0 def DoIt(h5): global xP,yP vs.BeginGroup() (p1,p2) = vs.GetBBox(h5) p1x=p1[0] p1y=p1[1] p2x=p2[0] p2y=p2[1] p3x = p2x-p1x p3y = p1y-p2y vs.Symbol(vs.GetSDName(h5),xP+((p3x/2)-p2x),yP+((p3y/2)-p1y),0) vs.TextOrigin(xP+40,yP) vs.TextSize(9) vs.TextVerticalAlign(3) vs.TextFont('Arial') vs.CreateText(vs.GetSDName(h5)) vs.DoMenuTextByName('UPPER CASE',0) vs.EndGroup() yP -= 25 hSEL = [] h1 =vs.FSymDef() while h1 != []: hSEL.append(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: hSEL.append(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) for h in hSEL: if vs.GetTypeN(h) == 16: DoIt(h) "Create Symbol Legend (Record)" script - uses "Legend Record" Record """ This script inserts all of the symbols in the current drawing resource manager into the drawing with the text in Record "Legend Record" and field "Legend Text" if assigned to a symbol. It ignores symbols with the record but no text in the "Legend Text" Field. Symbol and text are in an individual group. Use the distribute command to space them evenly after creation. First run will create "Legend Record" if it does not exist. This Python Script may be freely distributed. No warranty provided. Use at your own risk. David Hamer, 2021 revision 09/29/2021 """ xP = yP = 0 def DoIt(h5): global xP,yP vs.BeginGroup() (p1,p2) = vs.GetBBox(h5) p1x=p1[0] p1y=p1[1] p2x=p2[0] p2y=p2[1] p3x = p2x-p1x p3y = p1y-p2y vs.Symbol(vs.GetSDName(h5),xP+((p3x/2)-p2x),yP+((p3y/2)-p1y),0) vs.TextOrigin(xP+40,yP) vs.TextSize(9) vs.TextVerticalAlign(3) vs.TextFont('Arial') vs.CreateText(vs.GetRField(h5,'Legend Record','Legend Text')) vs.DoMenuTextByName('UPPER CASE',0) vs.EndGroup() yP -= 25 if vs.GetObject('Legend Record') == (): # Creates "Status and Phase" record if not present vs.NewField('Legend Record', 'Legend Text', '', 4, 0) hSEL = [] h1 =vs.FSymDef() while h1 != []: hSEL.append(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: hSEL.append(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) for h in hSEL: if vs.GetTypeN(h) == 16: if vs.GetRField(h,'Legend Record','Legend Text') != '': DoIt(h) "Create Symbol Legend (Tag)" script - uses "Tag" """ This script inserts all of the symbols in the current drawing resource manager into the drawing with the text in Record "Legend Record" and field "Legend Text" if assigned to a symbol. It ignores symbols with the record but no text in the "Legend Text" Field. Symbol and text are in an individual group. Use the distribute command to space them evenly after creation. First run will create "Legend Record" if it does not exist. This Python Script may be freely distributed. No warranty provided. Use at your own risk. David Hamer, 2021 revision 09/29/2021 """ xP = yP = 0 def DoIt(h5): global xP,yP vs.BeginGroup() (p1,p2) = vs.GetBBox(h5) p1x=p1[0] p1y=p1[1] p2x=p2[0] p2y=p2[1] p3x = p2x-p1x p3y = p1y-p2y vs.Symbol(vs.GetSDName(h5),xP+((p3x/2)-p2x),yP+((p3y/2)-p1y),0) vs.TextOrigin(xP+40,yP) vs.TextSize(9) vs.TextVerticalAlign(3) vs.TextFont('Arial') tagarray = vs.GetResourceTags(h) vs.CreateText(tagarray[0]) vs.DoMenuTextByName('UPPER CASE',0) vs.EndGroup() yP -= 25 hSEL = [] h1 =vs.FSymDef() while h1 != []: hSEL.append(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: hSEL.append(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) for h in hSEL: if vs.GetTypeN(h) == 16: tagarray = vs.GetResourceTags(h) if tagarray: DoIt(h) Legend Creator.vwx
  3. Try this. Not a schedule but this script works for me. The symbols are placed close together but after the legend is created I move the last group down and use the distribute command. File attached. """ This script inserts all of the symbols in the current drawing resource manager into the drawing with the symbol name. Symbol and text are in an individual group. Use the distribute command to space them evenly after creation. This Python Script may be freely distributed. No warranty provided. Use at your own risk. David Hamer, 2021 revision 09/29/2021 """ ecnt = reset = xP = yP = vcnt = ocnt =scnt= mcnt= pcnt = 0 def DoIt(h5): global xP,yP SymName = vs.GetSDName(h5) vs.BeginGroup() vs.Symbol(vs.GetSDName(h5),xP,yP,0) vs.TextOrigin(xP+50,yP) vs.TextSize(9) vs.TextFont('Arial') vs.CreateText(SymName) vs.DoMenuTextByName('UPPER CASE',0) vs.EndGroup() yP -= 25 hSEL = [] h1 =vs.FSymDef() while h1 != []: hSEL.append(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: hSEL.append(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) for h in hSEL: if vs.GetTypeN(h) == 16: DoIt(h) Legend Creator.vwx
  4. I wrote a simple python script that may help. """ This script will change any screen plane object in the drawing to Layer Plane. Once run you can disable "enable legacy 2D features" on the "2D legacy mode" tab in document settings. Notes: 1. Some objects may move to the 3D plane and not the Layer Plane. 2. You will also have to run this script on any referenced files first. This Python Script may be freely distributed. No warranty provided. Use at your own risk. David Hamer, 2021 revision 09-23-2021 """ def assign(h): vs.SetObjectVariableBoolean(h,1160,False) vs.ForEachObject(assign,"(INVIEWPORT & (PLA='Screen Plane'))") Script Screen Plane to Layer Plane.vwx
  5. I would like to have the option to set my naming scheme as default.
  6. I have been able to modify the "...\Plug-Ins\Common\Data\PubliemNames.xml" to move my options to the top of the list but is there any way to make mine default. It always defaults to "Sheet#-Sheet Title". Even if I delete it from the list my option is not default.
  7. With these mew advancements in the VGM will Vectorworks run faster on a Mac than a PC or are the advantages equal?
  8. Please add a don't show this again check box on the following messages when using the Eyedropper and Data Visualization. or Maybe a suppress messages for the rest of the drawing session. "Object has Data Visualization attribute overrides applied. but the original attributes will be picked up." and "Transferred attributes may be hidden by the active Data Visualization" To many ok's to click..
  9. Thank you this works great!!!
  10. Is there a script command to open the edit class dialog box. I would like to be able to edit the currently active class or a selected object's class without having to search the long list of classes in the class list.
  11. I am looking for a lidar scanner that I can mount on a tripod and scan a space with ease. Typically the spaces are not very large but I want something with decent range, accuracy and no monthly fee to export to Vectorworks. I have been using my iPhone 12 mounted to a tripod and it does not have quite enough range or accuracy. Please give me your recommendations.
  12. Data Visualization should be able to set the line weight without changing the line type.
  13. That’s cool but I wish you could tag symbols from outside the symbol.
  14. This is what I get when I open the document. Try closing and reopening the document. or restarting vectorworks or your computer Also about the reveals. The door appears to have some sort of header. It won't let me edit your door object.
  15. I recommend using classes to define the data visualization of the doors and window in sections. See attached. Multiple Data visualization_Renovation.vwx
  16. I do not believe it is possible to tag items in a symbol. You can tag the symbol but not the data within.
  17. Not to my knowledge. Sections are a bit difficult to work with sometimes. I have not had a lot of experience with the section viewports.
  18. You have to edit the Architect Workspace that you are using. The new command can be found in the import/export options on the left side of the editor. Move it to the right side of the editor.
  19. Pat answered the question well. You can combat this with class settings and possibly layering viewports. I would recommend watching the RENDERING FOR EVERYDAY ARCHITECTURAL DRAWING course. Also I have revised by scripts and they are below. A word of caution they use a different record. I revised the record to be "Status and Phase" to be more inline with the way others were using the terminology. I also added records for demolition and new construction notes. I would recommend not converting to the new format on an existing drawing because the new scripts do not work with the older data visualizations that I provided in the first files. But if you do want to I have written another script to convert a drawing using the old script to the new scripts. script = "Convert to new Status and Phase record script from old Record" You have to import the "Status and Phase" record into the old drawing before running the conversion script. It will convert everything with out selection. All of my Python Scripts may be freely distributed. No warranty provided. Use at your own risk. (Download newest versions below) Once you replace the scripts in you plugin folder the old record format will not work. Adding notes to the record you can use data tags to show the notes
  20. In trying out the new Export Unreal Datasmith many of the objects in my model are not present in Twinmotion. Has anyone else tried this? Is there a limit to the amount of objects that can be exported?
  21. Fixed it. Thanks! ecnt = reset = xP = yP = vcnt = ocnt =scnt= mcnt= pcnt = 0 def count(h4): global vcnt, ocnt, mcnt, ecnt,scnt,pcnt ocnt += 1 if vs.GetTypeN(h4) == 5: vcnt += vs.GetVertNum(h4) if vs.GetTypeN(h4) == 21: vcnt += vs.GetVertNum(h4) if vs.GetTypeN(h4) == 25: vcnt += vs.GetVertNum(h4) if vs.GetTypeN(h4) == 40: mcnt += 1 if vs.GetTypeN(h4) == 24: ecnt += 1 if vs.GetTypeN(h4) == 84: ecnt += 1 if vs.GetTypeN(h4) == 95: ecnt += 1 if vs.GetTypeN(h4) == 34: ecnt += 1 if vs.GetTypeN(h4) == 15: scnt += 1 if vs.GetTypeN(h4) == 86: scnt += 1 def DoIt(h5): global reset,xP,yP, vcnt, ocnt, mcnt,scnt, ecnt,pcnt vs.ForEachObjectInList(count, 0, 2, vs.FInSymDef(h5)) vs.SetRecord(h5,'Obj Count') vs.SetRField(h5,'Obj Count','Obj Count',vs.Num2Str(0,ocnt)) vs.SetRField(h5,'Obj Count','Vertex Count',vs.Num2Str(0,vcnt)) vs.SetRField(h5,'Obj Count','Mesh Count',vs.Num2Str(0,mcnt)) vs.SetRField(h5,'Obj Count','3D Volume Count',vs.Num2Str(0,ecnt)) vs.SetRField(h5,'Obj Count','Nested Symbol Count',vs.Num2Str(0,scnt)) vs.SetRField(h5,'Obj Count','PIO Count',vs.Num2Str(0,pcnt)) vcnt = ocnt = mcnt = ecnt =scnt =pcnt = 0 #reset to variable to 0 vs.Symbol(vs.GetSDName(h5),xP,yP,0) xP += 300 if xP > 5000: xP = 0 yP += 300 if vs.GetObject('Obj Count') == []: vs.NewField('Obj Count', 'Obj Count', '0', 4, 0) vs.NewField('Obj Count', 'Vertex Count', '0', 4, 0) vs.NewField('Obj Count', 'Mesh Count', '0', 4, 0) vs.NewField('Obj Count', '3D Volume Count', '0', 4, 0) vs.NewField('Obj Count', 'Nested Symbol Count', '0', 4, 0) vs.NewField('Obj Count', 'PIO Count', '0', 4, 0) hSEL = [] h1 =vs.FSymDef() while h1 != []: hSEL.append(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: hSEL.append(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) for h in hSEL: if vs.GetTypeN(h) == 16: DoIt(h)
  22. In def DoIt(h5): I am resetting the variables vcnt, ocnt, and mcnt to 0 but when it runs for h4 in hVP: the variables return to their state the last time def count(h4): was triggered by for h4 in hVP:. I want vcnt, ocnt, and mcnt to be 0 every time the for h4 in hVP: loop starts. Help please. I am checking the state of the variable at this point it the below script vs.SetRField(h5,'Obj Count','Obj Count',vs.Num2Str(0,ocnt)) vs.AlrtDialog(ocnt) #Displays current count but for somereason is adding the previous count to the current count vcnt = ocnt = mcnt = 0 #reset to variable to 0 vs.AlrtDialog(ocnt) #displays that variable has been reset to 0 reset = xP = yP = vcnt = ocnt = mcnt = 0 def count(h4): global vcnt, ocnt, mcnt ocnt += 1 if vs.GetTypeN(h4) == 5: vcnt += vs.GetVertNum(h4) if vs.GetTypeN(h4) == 21: vcnt += vs.GetVertNum(h4) if vs.GetTypeN(h4) == 40: mcnt += 1 def DoIt(h5): global reset,xP,yP, vcnt, ocnt, mcnt if h5 != []: if vs.GetTypeN(h5) == 16: GetHandles(h5) for h4 in hVP: count(h4) vs.SetRecord(h5,'Obj Count') vs.SetRField(h5,'Obj Count','Obj Count',vs.Num2Str(0,ocnt)) vs.AlrtDialog(ocnt) #Displays current count but for somereason is adding the previous count to the current count vcnt = ocnt = mcnt = 0 #reset to variable to 0 vs.AlrtDialog(ocnt) #displays that variable has been reset to 0 vs.SetRField(h5,'Obj Count','Vertex Count',vs.Num2Str(0,vcnt)) vs.SetRField(h5,'Obj Count','Mesh Count',vs.Num2Str(0,mcnt)) vs.Symbol(vs.GetSDName(h5),xP,yP,0) xP += 300 if xP > 5000: xP = 0 yP += 300 def GetHandles2(h1): while h1 != []: hSEL.append(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: hSEL.append(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) def GetHandles(h5): h2=vs.FInSymDef(h5) while h2 != []: hVP.append(h2) itParent = vs.GetTypeN(h2) # Get Parent type if itParent == 11: h3 = vs.FInGroup(h2) while h3 != []: hVP.append(h3) h3 = vs.NextObj(h3) h2 = vs.NextObj(h2) if vs.GetObject('Obj Count') == []: vs.NewField('Obj Count', 'Obj Count', '0', 4, 0) vs.NewField('Obj Count', 'Vertex Count', '0', 4, 0) vs.NewField('Obj Count', 'Mesh Count', '0', 4, 0) hVP = [] hSEL = [] GetHandles2(vs.FSymDef()) for h5 in hSEL: if vs.GetTypeN(h5) == 16: DoIt(h5)
  23. Thanks I have that working but now my counts and my symbol placements are off. My counts keep adding to the last symbols count and each symbol is being placed dead center in the drawing. They should be moving 300 to the right until 5000 is reached then move up 300 and so on. def DoIt(h5): global ocnt, vcnt, mcnt,reset ocnt = 0 vcnt = 0 mcnt = 0 reset = 0 xP = 0 yP = 0 if h5 != []: if vs.GetTypeN(h5) == 16: GetHandles(h5) reset = 0 for h4 in hVP: count(h4) reset = 0 vs.SetRecord(h5,'Obj Count') vs.SetRField(h5,'Obj Count','Obj Count',vs.Num2Str(0,ocnt)) vs.SetRField(h5,'Obj Count','Vertex Count',vs.Num2Str(0,vcnt)) vs.SetRField(h5,'Obj Count','Mesh Count',vs.Num2Str(0,mcnt)) vs.Symbol(vs.GetSDName(h5),xP,yP,0) xP = xP + 300 if xP > 5000: xP = 0 yP += 300 def count(h4): global ocnt, vcnt, mcnt,reset if reset != 1: ocnt = 0 vcnt = 0 mcct = 0 ocnt = ocnt + 1 if vs.GetTypeN(h4) == 5: vcnt = vcnt + vs.GetVertNum(h4) if vs.GetTypeN(h4) == 21: vcnt = vcnt + vs.GetVertNum(h4) if vs.GetTypeN(h4) == 40: mcnt = mcnt+ 1 reset = 1 def GetHandles2(h1): while h1 != []: hSEL.append(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: hSEL.append(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) def GetHandles(h5): h2=vs.FInSymDef(h5) while h2 != []: hVP.append(h2) itParent = vs.GetTypeN(h2) # Get Parent type if itParent == 11: h3 = vs.FInGroup(h2) while h3 != []: hVP.append(h3) h3 = vs.NextObj(h3) h2 = vs.NextObj(h2) if vs.GetObject('Obj Count') == []: vs.NewField('Obj Count', 'Obj Count', '0', 4, 0) vs.NewField('Obj Count', 'Vertex Count', '0', 4, 0) vs.NewField('Obj Count', 'Mesh Count', '0', 4, 0) hVP = [] hSEL = [] GetHandles2(vs.FSymDef()) for h5 in hSEL: if vs.GetTypeN(h5) == 16: DoIt(h5)
×
×
  • Create New...