Acroplot to PDF (specified folder) button

Acroplot to PDF (specified folder) button

Anonymous
Not applicable
365 Views
5 Replies
Message 1 of 6

Acroplot to PDF (specified folder) button

Anonymous
Not applicable
We use Acroplot. Here's the process I need to improve:

User completes a drawing and it gets approved, we then need to create a PDF using Acroplot and have that PDF go to a specified folder on one of our servers.

But any other time, we simply create PDFs for checking (along the approval process) and it goes in the same folder as the .dwg file. I really need this 'toggle' flexibility (between destination folders).

Basically I'm thinking a "Release" button in AutoCAD that would create that PDF and place it in the correct folder - thus eliminating any human error.

Has anyone ever done this? I'm pretty good with Microsoft VBA and scripting in AutoCAD over the years, just not sure where to get started.

I did contact CadZation and they showed me the samples folder that came with Acroplot. I'm just not sure where to place the VB code they show in their example. I've never used VB in Acad. How? Any thoughts on an even better solution to my process? Thank you.

-Robert
0 Likes
366 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
maybe you could post their code?

you might be able to use the FileSystemObject to move the file after its created.

Dim oFso As Object
Set oFso = CreateObject("Scripting.FileSystemObject")
... specify source name and destination name
oFso.MoveFile sSourceFile, sDestinationFile
0 Likes
Message 3 of 6

Anonymous
Not applicable
I like this idea - saves me from having to make another PDF with Acroplot.

Where does that VB code you listed get placed? In an Acad button? I only have experience with Microsloth Access VBA...thank you.
0 Likes
Message 4 of 6

Anonymous
Not applicable
welll...

in autocad type 'vbaide'
insert a module

insert somethin like this code

Sub movePDF
Dim oFso As Object
Set oFso = CreateObject("Scripting.FileSystemObject")
Dim existFullName As String
Dim newFullName As String
Dim existShortName As String
existShortName = Replace(ThisDrawing.name, ".dwg", ".PDF")
existFullName = Replace(ThisDrawing.FullName, ".dwg", ".PDF") ' assumes pdf in dwg folder
newFullName = "G:\foldername\" & existShortName
oFso.MoveFile existFullName, newFullName
End Sub

i am back in 2004, don't know if things have changed much but i have vba commands loaded in a lisp file that is automatically loaded with each drawing. Could also be assigned to a button.

e.g.
(defun c:MOVEPDF() (COMMAND "-VBARUN" "MODULE1.MOVEPDF")(PRINC))

maybe someone else could answer if you need to set a reference for the filesystemobject e.g. Tools, Reference
0 Likes
Message 5 of 6

Anonymous
Not applicable
Hi,

Standard VBA can also do this:

Sub movePDF
Dim existFullName As String
Dim newFullName As String
Dim existShortName As String
existShortName = Replace(ThisDrawing.name, ".dwg", ".PDF")
existFullName = Replace(ThisDrawing.FullName, ".dwg", ".PDF") ' assumes
pdf in dwg folder
newFullName = "G:\foldername\" & existShortName
FileCopy existFullName, newFullName
Kill existFullName ' Only use if you don't want ot keep the local copy
End Sub

An alternative lisp function to run it is:

(defun c:MOVEPDF() (VL-LOAD-COM) (VL-VBARUN" "MODULE1.MOVEPDF")(PRINC))

--


Regards

Laurie Comerford

wrote in message news:5870706@discussion.autodesk.com...
welll...

in autocad type 'vbaide'
insert a module

insert somethin like this code

Sub movePDF
Dim oFso As Object
Set oFso = CreateObject("Scripting.FileSystemObject")
Dim existFullName As String
Dim newFullName As String
Dim existShortName As String
existShortName = Replace(ThisDrawing.name, ".dwg", ".PDF")
existFullName = Replace(ThisDrawing.FullName, ".dwg", ".PDF") ' assumes pdf
in dwg folder
newFullName = "G:\foldername\" & existShortName
oFso.MoveFile existFullName, newFullName
End Sub

i am back in 2004, don't know if things have changed much but i have vba
commands loaded in a lisp file that is automatically loaded with each
drawing. Could also be assigned to a button.

e.g.
(defun c:MOVEPDF() (COMMAND "-VBARUN" "MODULE1.MOVEPDF")(PRINC))

maybe someone else could answer if you need to set a reference for the
filesystemobject e.g. Tools, Reference
0 Likes
Message 6 of 6

Anonymous
Not applicable
thanks laurie, i did not know that...
0 Likes