Hi All
I am using autocad 2002 and pdf995 to generate pdf files
I have constructed a VBA program to copy the drawing name to the clipboard since the saving name in pdf995 is malformed
The program sucessfully copyies the name to clipboard ( i have tested this)
However if i tryto plot the drawing using the -plot command, both autocad and pdf995 hangs
It is almost like autocad hasn't released the clipboard and pdf995 is waiting for access. but control is not returned to auocad until pdf995 has done its job - ie circular dependancies ( i think)!!
here is the VBA code
Sub VTC() 'short for SystemVariableToClipboard
toClipboard
End Sub
Sub toClipboard() 'short for SystemVariableToClipboard
Dim objectList As New DataObject
Dim param As String
Dim parameterArray() As String
Dim ref As String
parameterArray() = Split(ThisDrawing.Utility.GetString(False), ' ')
For i = 0 To UBound(parameterArray)
ref = ref & getSysVar(parameterArray(i))
If UBound(parameterArray) > 0 Then ref = ref & vbNewLine
Next i
objectList.SetText ref
objectList.PutInClipboard
End Sub
Private Function getSysVar(varName As String) As String
Dim SysVar As String
Dim i As Integer
On Error Resume Next
SysVar = ThisDrawing.GetVariable(varName)
If Err <> 0 Then
Err.Clear
SysVar = varName
ElseIf varName = 'DWGNAME' Then 'REMOVE DRAWING FILE EXTENSIOIN IE '.dwg'
Do
If Mid(SysVar, Len(SysVar) - i, 1) = '.' Then
SysVar = Left(SysVar, Len(SysVar) - i - 1)
i = Len(SysVar)
Else
i = i + 1
End If
Loop While i < Len(SysVar)
End If
getSysVar = SysVar
End Function
and here is how i am invoking it
(DEFUN C:DTC () (COMMAND '-VBARUN' 'VTC' 'DWGNAME'))
typing dtc to start the copy process
Finally i am using a macro to plot using the -plot command
Both programs work indivually but not together.
some URGENT help would be greatly appreciated
Phill
AutoLISP: Copy Block with New Name. Posted on May 3, 2011 by AutoCAD Tips. But here's a quick way to do it with LISP. (setq OldBlockName (entsel ' nSelect Block to copy: ')). Do you Get any error saying that the copy to clipboard failed? This isn't the Copy command that is native to AutoCAD, it is the Copy command that is native to Windows. Copying objects in Windows places a copy into the Clipboard. Typically the clipboard only holds one object at a time, but the Clipboard Manager from the Labs can contain and manage multiple copies.
I am in need of some help very quickly to finish a jobI am using autocad 2002 and pdf995 to generate pdf files
I have constructed a VBA program to copy the drawing name to the clipboard since the saving name in pdf995 is malformed
The program sucessfully copyies the name to clipboard ( i have tested this)
However if i tryto plot the drawing using the -plot command, both autocad and pdf995 hangs
It is almost like autocad hasn't released the clipboard and pdf995 is waiting for access. but control is not returned to auocad until pdf995 has done its job - ie circular dependancies ( i think)!!
here is the VBA code
Sub VTC() 'short for SystemVariableToClipboard
toClipboard
End Sub
Sub toClipboard() 'short for SystemVariableToClipboard
Dim objectList As New DataObject
Dim param As String
Dim parameterArray() As String
Dim ref As String
parameterArray() = Split(ThisDrawing.Utility.GetString(False), ' ')
For i = 0 To UBound(parameterArray)
ref = ref & getSysVar(parameterArray(i))
If UBound(parameterArray) > 0 Then ref = ref & vbNewLine
Next i
objectList.SetText ref
objectList.PutInClipboard
End Sub
Private Function getSysVar(varName As String) As String
Dim SysVar As String
Dim i As Integer
On Error Resume Next
SysVar = ThisDrawing.GetVariable(varName)
If Err <> 0 Then
Err.Clear
SysVar = varName
ElseIf varName = 'DWGNAME' Then 'REMOVE DRAWING FILE EXTENSIOIN IE '.dwg'
Do
If Mid(SysVar, Len(SysVar) - i, 1) = '.' Then
SysVar = Left(SysVar, Len(SysVar) - i - 1)
i = Len(SysVar)
Else
i = i + 1
End If
Loop While i < Len(SysVar)
End If
getSysVar = SysVar
End Function
and here is how i am invoking it
(DEFUN C:DTC () (COMMAND '-VBARUN' 'VTC' 'DWGNAME'))
typing dtc to start the copy process
Finally i am using a macro to plot using the -plot command
Both programs work indivually but not together.
some URGENT help would be greatly appreciated
Phill