muck Posted April 15, 2013 Posted April 15, 2013 I have used TrueConvert to load a page setup into a group of drawings. Now I would like to make that page setup current using some type of batch method for the group of drawings. Is there a way to do that? If not is there a VBA script that I might be able to put in a loop to help me do that. Thank you, Quote
BlackBox Posted April 15, 2013 Posted April 15, 2013 You may find my vla-SetActivePageSetup function to be useful. Quote
muck Posted April 15, 2013 Author Posted April 15, 2013 Can VBA be used to set a pagesetup name to current instead of Lisp or net? Thank you, Quote
BlackBox Posted April 15, 2013 Posted April 15, 2013 Can VBA be used to set a pagesetup name to current instead of Lisp or net?Thank you, No idea... I skipped VBA, and went from LISP --> .NET API. Quote
muck Posted April 15, 2013 Author Posted April 15, 2013 So how do you use the (vla-SetActivePageSetup layoutname “YourPageSetupName”) in lisp. When I cut/paste it into a simple lisp routine I get "; error: no function definition: VLA-SETACTIVEPAGESETUP" Thank you, Quote
BlackBox Posted April 15, 2013 Posted April 15, 2013 Sorry for not being more clear.... The link I provided is for a custom .NET plug-in which implements a LispFunction named vla-SetActivePageSetup and is not part of AutoCAD OOTB, which is why you've received that error. You've not loaded the .NET assembly, so it cannot find the function. To load the dependent assembly, you use the NETLOAD Command, but first, you need to compile the source-code I posted in that other thread to .DLL file for your version of AutoCAD. Quote
muck Posted April 15, 2013 Author Posted April 15, 2013 I have visual studio 2010 with VB.net on my machine. So how do I do this? Could you give instructions on how to do this? Thank you, Quote
irneb Posted April 16, 2013 Posted April 16, 2013 You'll need to start a new blank DotNet library in VS (i.e. to be compiled into a DLL). Then you need to tell VS which links to use, in this case ACad's DotNet entry points, like acdbmgd.dll and acmgd.dll (there might be others as well depending on the version of ACad you use). These are found in ACad's program folder. Then you copy past BlackBox's source code into a new class file and press compile. Alternative to starting a blank project, you could download the ObjectARX SDK for your version of acad. It should either contain a wizzard for starting a AutoCAD DotNet project or some samples which you can use as a template. Alternatively, I've implemented a pure-lisp version previously in the same thread BlackBox has linked to: http://forums.augi.com/showthread.php?80461-Page-Setup-Manager&p=851675&viewfull=1#post851675 Save the LSP & DCL files into a support folder. Then to have it run across several DWG's use scripting with something like ScriptPro / AutoScript similar to the script in the post above. Quote
BlackBox Posted April 16, 2013 Posted April 16, 2013 Muck, you may find this thread to of help: Where to Start with .NET? Quote
BlackBox Posted April 16, 2013 Posted April 16, 2013 FWIW - Attached is an Autoloader .bundle for 2012 (R18.2), 2013 (R19.0), and 2014 (R19.1)... Simply unzip to %AppData%\Autodesk\ApplicationPlugins. ** Also important to note, is that ./Contents/Windows/2012/bbox_AcPageSetup18.dll has been compiled to .NET 3.5 which makes it available for both 2010 (R18.0), and 2011 (R18.1) as well... Since these versions do not support Autoloader, simply use NETLOAD Command, or Registry Loader. bbox_AcPageSetup.bundle.zip Quote
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.