Jump to content

Evert Vandeberg

Member
  • Posts

    8
  • Joined

  • Last visited

Reputation

0 Neutral

Personal Information

  • Location
    Belgium

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for the tip. I am a beginner and I managed. Below is the code. import os # hier wordt het operating system van apple geladen om de bestanden te kunnen aanmaken import vs #dit mag aanstaan of afstaan OBJECTS = [] def collect(handle): OBJECTS.append(handle) """ UITLEG: vs.ForEachObject(collect, '((T=LOCUS3D) AND (SEL=True))') De functie "collect" wordt geactiveerd en ALLES wordt verzamelt [handle1, handle2, handle3.....] (ook bijvoorbeeld polylijnen (handle 3)) Hier kunnen ook andere objecten (bijvoorbeeld polylijnen) inzitten maar het 2de argument bestaande uit 2 voorwaarden, filtert de 3d-locussen eruit binnen de selectie[handle1, handle2,.....] eruit. Omdat handle 3 een polylijn is wordt deze eruit gefiltert """ vs.ForEachObject(collect, '((T=LOCUS3D) AND (SEL=True))') # de voorwaarden moeten in een STRING staan coordinaten = [] for obj in OBJECTS: center = vs.Get3DCntr(obj) if len(center) == 2: # Controleer of er X- en Y-coördinaten zijn x, y = center[0] # Haal X- en Y-coördinaten uit de center tuple coordinaten.append((x, y)) # Bepaal de uitvoermap en het bestandspad output_folder = '/Users/evertvandeberg/Documents/dossier' # Vervang dit door de gewenste uitvoermap output_file = os.path.join(output_folder, 'locuspunten.txt') # Schrijf de coördinaten naar het tekstbestand with open(output_file, 'w') as file: for i, coord in enumerate(coordinaten): if i != 0: file.write(', ') file.write('{}'.format(coord)) vs.AlrtDialog('Locuspunten zijn geëxporteerd naar {}'.format(output_file))
  2. I need a list that I can then feed into pycharm so that I can do calculations with this list. Do you have a suggestion on how I should handle this. The code returns a list with all handles in it. How do I extract the coordinates and put them in a list?
  3. My intention is to create a script where I select self-inserted 3dlocus points. From this selection I need the X,Y and Z coordinates . I want to export this list to a txt file. Below is my attempt. Can you help me with this? Thanks in advance. xwaarde= vs.XCoordinate("(T=LOCUS3D) AND (SEL=True)") ywaarde= vs.YCoordinate("(T=LOCUS3D) AND (SEL=True)") zwaarde= vs.ZCoordinate("(T=LOCUS3D) AND (SEL=True)") CountValue = vs.Count("(T=LOCUS3D) AND (SEL=True)") vs.Message("xwaarde ",xwaarde ," ywaarde ",ywaarde," zwaarde ",zwaarde, " Totaal locuspunten ",CountValue) # Is this the way? OBJECTS = [] def collect(handle): OBJECTS.append(handle) vs.ForEachObject(collect, '((VSEL=TRUE))') vs.AlrtDialog('Num selected objects: {}'.format(len(OBJECTS)))
  4. It doesn't work. I also specified the paths where VW should normally be able to find the files.
  5. I want to install NUMPY and SCIPY in Vectorworks on an IMAC. How should I go about this?
×
×
  • Create New...