Automate monotone task, convert tif to dwg

Automate monotone task, convert tif to dwg

Ystrm_Bek
Explorer Explorer
1,822 Views
4 Replies
Message 1 of 5

Automate monotone task, convert tif to dwg

Ystrm_Bek
Explorer
Explorer

Hello

 

Hopefully this is the right forum to ask this.

We currently have a vault with alot of old .tif files that we want to convert to dwg files.

The way we do this is following these steps:

-Get .tif file

-Create new Autocad file

-Insert .Tif file in Autocad through Raster design

-Image embed (delete link with .tif file)

-Save new file as dwg

-Replace file in Vault.

 

Is there any way that one could automate a task like this? I'm very new to programming and have never created an add-in or something like that. I've just done some basic ilogic programming in Inventor. I don't know if I'm grasping for too much, but it seems like ther should be a better way to do this. It's a fairly easy task, but a big time consumer for our company.

 

 

0 Likes
1,823 Views
4 Replies
Replies (4)
Message 2 of 5

Markus.Koechl
Autodesk
Autodesk

Hello, this task sounds like a perfect fit for Vault Job Processing. And it might be the quickest solution to reach out to an Autodesk Vault reseller or CoolOrange (powerJobs).  They have existing job frameworks that allow configuring your task instead of programming it from scratch. However, the actions within AutoCAD might need some additional scripting.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 5

Nick_Hall
Collaborator
Collaborator

Hello

You don't say whether this is a one-off task, or whether it's something that will happen continuously

 

If it is the second option, I would agree with @Markus.Koechl and use Vault Job Processor

 

If it is the first, I'd use something simple - AutoCAD scripts

 

A simple script that does what you want is

FILEDIA
0
IINSERT
C:\Temp\bitonal_file_example_TIFF_1MB.tiff
NO
ZOOM
EXTENTS
IEMBED

SAVE
C:\Temp\bitonal_file_example_TIFF_1MB.dwg

 

You can start AutoCAD and make it run a script file using the command line

 

See https://help.autodesk.com/view/ACD/2023/ENU/index.html?guid=GUID-7FDC500C-E04A-432D-A73D-EB1B6C6728B...

 

The full set of command line switches is here - https://help.autodesk.com/view/ACD/2023/ENU/index.html?guid=GUID-8E54B6EC-5B52-4F62-B7FC-0D4E1EDF093...

 

So the process you could use is

  1. Download the TIFF files from Vault
  2. Generate a script for each drawing, and a batch file to run the scripts
  3. Run the batch file
  4. Use the AutoCAD Vault add-in to check in all the DWGs

Also, with a bit of thought/work, it would be possible to create a single batch file that combines steps 2 & 3

 

If you are interested in this approach, let me know. I might be able to point you in the correct direction

 

Nick

0 Likes
Message 4 of 5

Ystrm_Bek
Explorer
Explorer

Hello and thanks for the reply.

 

It's the second option. We have a Vault with a very large number of raster drawings, scattered over hundreds of folders. Every now and then we have to work with these files, and it'd be great if one could convert it to a dwg with a click of a button. 

 

The first option you explained, with autocad macro is certainly doable, but it does not save that much time as I'd hoped. My goal is to not have to do the "download - change - replace" action, since we're not working with the drawings in bulk, it's mostly one at a time.

 

I'll look closer into the Vault Job processor, and see what it can do.

Thank you

 

 

0 Likes
Message 5 of 5

Nick_Hall
Collaborator
Collaborator

Hi again

 

Using Job Processor, the job would have to be run against the TIFF file

 

The simplest flow of the job would be

 

  1. Download the TIFF file to a temporary folder
  2. Write a script file as above to the temporary folder
  3. Copy a template drawing to the temporary folder, with a suitable name
  4. Run the script using AutoCAD, on the new DWG, which will import the TIFF file and save it
  5. Add the DWG to Vault, in the same folder as the TIFF file
  6. Tidy up the temporary folder

You can do all of this as a custom job, but it has to be written in C# or VB.NET.

 

Another option, if you are not confident with building add-ins, is to use an add-in for Job Processor, called powerJobs by coolOrange - https://www.coolorange.com/powerjobs which allows you to create custom jobs as scripts, using PowerShell - https://learn.microsoft.com/en-us/powershell/

 

Personally, I would use powerJobs because the speed of development is faster, but both methods will work

 

One other thing, regardless of which method you use to write your custom job, the machine that you run the Job Processor on will need a license of AutoCAD as well as the Vault Pro license, so you will either need to run it on one of your CAD workstations, or buy new VP + AutoCAD licenses if you want to implement a dedicated Job Processor

 

Finally, you'll need a way of submitting the job to the queue, which could be via a Lifecycle State change, or a tool such as qJob https://apps.autodesk.com/VLTC/en/Detail/Index?id=5159126042722483562&appLang=en&os=Win32_64

Hope that's all useful

 

Nick

 

 

0 Likes