Cad_Jockeys Posted September 2, 2008 Share Posted September 2, 2008 Hello all. I was wondering if it would be possible for someone to write a vba/lisp automation to bind and then plot multiple drawings. I have 100+ drawings that need to be plotted/pdf and the task is very tedious when done manually. Any help would be great. Thanks in advance. -Cad Jockeys Quote Link to comment Share on other sites More sharing options...
borgunit Posted September 2, 2008 Share Posted September 2, 2008 DO you know any VB already. What I have written, calls from different methods in AutoCAD that are not totally present in the code I can give. Quote Link to comment Share on other sites More sharing options...
Cad_Jockeys Posted September 3, 2008 Author Share Posted September 3, 2008 I know very little about VB. I took a course in it many years ago and I am in the process of re-learing, but as of now....I got nothing. Quote Link to comment Share on other sites More sharing options...
borgunit Posted September 3, 2008 Share Posted September 3, 2008 This may raise more questions than it answers. Keep asking. I am sure we can help as you ask. Public Function BindXrefs() '------------------------------------------------------------------------------ 'Binds Xrefs to drawing without prefix 'Delete Xref from drawing and then insert file and explode it '------------------------------------------------------------------------------ Dim acBlkRef As AcadBlockReference Dim sXref As String ''''''''''''''''''''''''''''''''''''''' On Error GoTo ErrHandler sXref = GetXrefPath If sXref <> "" Then sXref = dhTrimLeft(sXref, "\", True, -1) 'Remove path info sXref = dhTrimRight(sXref, ".") 'Remove .dwg extension ThisDrawing.SendCommand "-XREF" & vbCr & "D" & vbCr & sXref & vbCr ThisDrawing.PurgeAll sXref = sXref & ".dwg" acBlkRef = InsertBlkRef(sXref) Set acBlkRef = Nothing End If ExitHere: Exit Function ErrHandler: Debug.Print Err.Number, Err.description, "Function 'BindXrefs' Failed" End Function Private Function GetXrefPath() As String '------------------------------------------------------------------------------ ' 'Returns: XREF drawing path i.e. "1000-01_01.dwg" 'Caveats: Assuming no nested xrefs and only one per drawing '------------------------------------------------------------------------------ Dim acXref As AcadExternalReference Dim acSS As AcadSelectionSet Dim acBlks As AcadBlocks Dim acBlk As AcadBlock Dim acEnt As AcadEntity Dim sPath As String Dim sEntType As String ''''''''''''''''''''''''''''''''''''''' On Error GoTo ErrHandler sEntType = "INSERT" Set acSS = GetEntitySS(sEntType) Set acBlks = ThisDrawing.Blocks For Each acEnt In acSS Set acBlk = acBlks(acEnt.Name) If acBlk.IsXRef Then Set acXref = acEnt sPath = acXref.Path Exit For End If Next acEnt GetXrefPath = sPath ExitHere: Exit Function ErrHandler: Debug.Print Err.Number, Err.description, "Function 'GetXrefPath' Failed" End Function Quote Link to comment Share on other sites More sharing options...
asos2000 Posted December 30, 2008 Share Posted December 30, 2008 mr. borgunit I created a *.txt and pasted the code then renamed to bind.dvb when trying to load in autocad there is a wrong message saying "WRONG FILE FORMAT" Is what i did correct or not? and there are more questions - Is this code will do the 2 steps ( bind then plot to PDF) without opening the file? - Will ask me about the files path? - could that code create a folder (called BOUND) to save the original dwgs or should i make a copy? - Will the saving of the PDF files being in the same path (or new folder as well)? - Will ask me about the layout (if the file has multiable layouts) which i want to plot? - Will ask me about the plotting configuration? Sorry for too much questions. Quote Link to comment Share on other sites More sharing options...
TommyG Posted January 5, 2009 Share Posted January 5, 2009 sorry to dig this up, but you could use autocads entransmit to batch bind the files, then the publish command to plot them all Quote Link to comment Share on other sites More sharing options...
asos2000 Posted January 6, 2009 Share Posted January 6, 2009 TommyG whats autocads entransmit Quote Link to comment Share on other sites More sharing options...
TommyG Posted January 6, 2009 Share Posted January 6, 2009 under the "File" menu, about half way down, its called "eTransmit" it will automatically issue drawings, as a zip, .exe or into a folder, in whichever format, and will bind xref's if you want it to. plus it sends fonts, plot styles and files with the dwg's, so when the person at the other end opens them, there are no issues. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.