Author Topic: set a default page setup for all drawing in folder  (Read 4996 times)

0 Members and 1 Guest are viewing this topic.

stevedallas

  • Guest
Re: set a default page setup for all drawing in folder
« Reply #15 on: July 30, 2014, 09:37:15 PM »
Am using it correctly?
(foreach layoutname (layoutlist) (vla-SetActivePageSetup layoutname “pdf 30-42”))

layoutlist gets the list of all layouts in the drawing and puts in the variable layoutname.
"for each" layout in that list run vla-setactivepasetup using the names in the "layoutname" variable and set the active page setup to "pdf 30-42".

When I installed it, unzipped it into appdata/roaming/autodesk/.../applicationplugins
mapped the subfolder under the bundle content/windows/2012/... to the support folders.
and to acaddoc.lsp I added the .net command that maps the dll file.

BlackBox

  • King Gator
  • Posts: 3770
Re: set a default page setup for all drawing in folder
« Reply #16 on: July 31, 2014, 08:41:31 AM »
Am using it correctly?
(foreach layoutname (layoutlist) (vla-SetActivePageSetup layoutname “pdf 30-42”))

layoutlist gets the list of all layouts in the drawing and puts in the variable layoutname.
"for each" layout in that list run vla-setactivepasetup using the names in the "layoutname" variable and set the active page setup to "pdf 30-42".

When I installed it, unzipped it into appdata/roaming/autodesk/.../applicationplugins
mapped the subfolder under the bundle content/windows/2012/... to the support folders.
and to acaddoc.lsp I added the .net command that maps the dll file.

The first thing I noticed yesterday, when copying your test code from here (assuming you mean layoutname in foreach), is that the characters included as your quote symbol is not accepted; I had to delete those characters and re-type the quote symbol as part of my named page setup string and all worked just fine.



As for a crash course on how to properly handle Autoloader .bundles... Start by removing everything you added to Support File Search Path (SFSP), and AcadDoc.lsp file, as these are not necessary.

The aptly named Autoloader mechanism automatically loads all of the necessary components for you, and is essentially plug-and-play.

Simply extract the .bundle.ZIP file to ../ApplicationPlugins/ directory... Just be mindful that the ./Contents/ folder and PackageContents.xml file are located within the .bundle's top folder, some extraction tools will place the extracted .bundle within a folder of same name, i.e., ../ApplicationPlugins/foo.bundle/foo.bundle/Contents/, if that makes sense? (see image below)

Start AutoCAD... That's it. You're done. The .bundle is loaded automagically, and the custom LispFunction is available for use.



Also worthy of note, is that .bundles who's Components are set LoadOnAutoCADStartup="true" (as this plug-in is), the dependent .NET assembly is loaded prior to any Acad* files in the startup sequence... Which in this case means you can add a call to the custom LispFunction within AcadDoc.lsp to always set your desired named page setup active (for all layouts) at drawing open as I've been doing for the past few years.
"How we think determines what we do, and what we do determines what we get."