Python Forum
Help coding 3d software automation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help coding 3d software automation
#1
I'm trying to alter code written by the software when recording a macro to refer to a general location so that I can use the macro to run for any new individual case I am in.

geo.open(0, 1, u'Y:\\01008-003\\01008-003 APPROVAL\\01008-003 SFA.dxf')
geo.import_file(1, 1, u'Y:\\01008-003\\01008-003s\\01008-003_stn2_stn2_2019-04-02__09-17-23 Model 1 Low.stl')
The Y drive is our network folder and the '01008-003 is a folder within that drive. The first line opens a file in the '01008-003 Approval' folder within the parent folder.

The next line imports another file in another sub folder.

I want to be able to perform this action on any parent folder I am working in.

The software is called Geomagic. It is a 3d modeling software. Any help is appreciated. Shifty
Reply
#2
You can try this
import os
import datetime as dt
drive = 'Y:'
base = '01008-03'
dd = dt.datetime(2019, 4, 2, 9, 17, 23)
folder_a = os.path.join(drive, base, '{} APPROVAL'.format(base))
file_a = os.path.join(folder_a, '{} SFA.dfx'.format(base))
folder_s = os.path.join(drive, base, '{}s'.format(base))
file_s = os.path.join(folder_s, '{base}_stn2_stn2_{dd:%Y-%m-%d__%H-%M-%S} Model 1 Low.stl'.format(base=base, dd=dd))
print(file_a)
print(file_s)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there software/tool for coding Python? dee 11 2,804 Jun-14-2022, 02:32 PM
Last Post: dee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020