I am still having issues.
Layouts are uniquely named.
Page setups exist in the drawing.
Layouts are mapped to page setups.
Still getting "Nothing selected to change." message
Even tried it with multiple layout tabs selected.
What gives? Any ideas?
![]() |
|
![]() |
|
![]() |
|
![]() |
I am still having issues.
Layouts are uniquely named.
Page setups exist in the drawing.
Layouts are mapped to page setups.
Still getting "Nothing selected to change." message
Even tried it with multiple layout tabs selected.
What gives? Any ideas?
There must be something else going on then, it works fine for me (see attached). Maybe it's incompatible with your version of ACad? The sample shows Vanilla 2008.
OK, it's working!
The files were not in the support path, despite my earlier claims. Sorry for the inconvenience, and thanks for the awesome file!
This LSP is great, I have been looking for something like this for a while.
Is it possible to launch this from a tool palette, or even better, I already have a tool palette icon that inserts the commonly used page setups, is it possible to add this to the command string in my existing tool palette that will set "KM_A1-A3" current.
The palette command string currently looks like this
(command "-psetupin" "KM.dwt" "KM_A1-A3,KM_A1_DRAFT,KM_A1_final,KM_PDF")
Note: this works only with Expert system variable set to 3.
never mind, sorted that out
^c^c-psetupin;km.dwt;KM_A1-A3,KM_A1_DRAFT,KM_A1_final,KM_PDF;-MPAGESETUP;*;KM_A1-A3;
Just saved and tested the LayoutTools.lsp, and it works! This has been a thorn in my side for a long time. Finally had it somewhat solved with the DWGTrueView fix, which seems to have stopped working.
Page setups are added to drawings, only hitch is that with 2013, it does not set a pagesetup to "current", and in the dialog pictured above, it looks like it has done so. Am I missing a step somewhere?
I also do not get any dialogs to select tabs to apply it to, but it works when I select tabs ahead of running the LSP. Is this how it is supposed to work?
PageSetup.JPG
Zombies!
I don't recall if LISP can set a page setup current, without a call to the -PLOT Command, which precludes the ability to batch process a directory of drawings via ObjectDBX. This is possible via .NET API however. I've been toying with the idea of adding a plug-in that can do this, but haven't made the time... Perhaps if others would also benefit, I'd make some time in the coming weeks when possible.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Here's a temporary work around for 2012 and older... I know... You're asking about 2013, but I do not have the ObjectARX 2013/2014 SDK installed at work, only at home sadly. I consider this to be a' temporary' work around, as it is but a simple CommandMethod Method (read a Command) at this time... Meaning for this to work one would need to invoke the "AcPageSetup" Command.
My intention is to make this available as a LispFunction Method (read a LISP function) so one can employ this functionality in other LISP routines, and offer an optional enhanced Command to batch process a directory of Drawings.
In any event, here's the best I could with part of my lunch break:
Code:using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; using acApp = Autodesk.AutoCAD.ApplicationServices.Application; [assembly: CommandClass(typeof(AUGI.Sample.PageSetup.Commands))] namespace AUGI.Sample.PageSetup { public class Commands { [CommandMethod("AUGI", "AcPageSetup", CommandFlags.Session)] public void AcPageSetup() { Document doc = acApp.DocumentManager.MdiActiveDocument; Database db = doc.Database; string pageSetupName = "YourPageSetupName"; using (DocumentLock docLock = doc.LockDocument()) { using (Transaction trans = db.TransactionManager.StartOpenCloseTransaction()) { LayoutManager acLayMan = LayoutManager.Current; Layout oLayout = trans.GetObject( acLayMan.GetLayoutId(acLayMan.CurrentLayout), OpenMode.ForRead) as Layout; if (oLayout != null) { DBDictionary acPlotSettings = trans.GetObject(db.PlotSettingsDictionaryId, OpenMode.ForRead) as DBDictionary; if (acPlotSettings.Contains(pageSetupName)) { PlotSettings ps = (PlotSettings)trans.GetObject( acPlotSettings.GetAt(pageSetupName), OpenMode.ForRead); oLayout.UpgradeOpen(); oLayout.CopyFrom(ps); trans.Commit(); } else doc.Editor.WriteMessage("\n** Page setup not found ** "); } } doc.Editor.Regen(); } } } }
I'll post the assemblies (the .dll, read compiled code) when I am able to build the 2013 compatible project at my soonest convenience.
Last edited by BlackBox; 2013-03-20 at 09:53 PM. Reason: Added a 'Page Setup Not Found' error message
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Actually, the more I think about this, it might be useful to incorporate an external settings file (.XML) (rather than hard-coding the named page setup as shown above), that can be located within a given project, as I know in my limited experience it's often necessary to have a different named page setup applied as default for different projects (i.e., different client standards, etc.)... This just might turn into a nifty little project.![]()
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000