How can I call the "Apply to Layout" button in the plot windows using vba? ApplytoLayout.png
|
How can I call the "Apply to Layout" button in the plot windows using vba? ApplytoLayout.png
I am kinda new to this all VBA Autocad. So I put together a code that opens the drawings, sets the printer name, plot style, and plot settings of each individual drawing depending on specific block attribute exported from each drawing and depending on user input I export the drawing to pdf or print the respective drawing to the printer I set. I got the code working, now I would like to "Apply to layout" those plot setting prior to saving and closing the drawings. Or any way I can have those plot settings saved to the layout so the next person that opens the drawings would see those same parameters.
If I were to do it manually after running my code it would be to go the <Previous plot> page setup and press "Apply to layout" how can i do that using the PLOT command?
My old vla-SetActivePageSetup custom .NET LispFunction may be of some help:
http://forums.augi.com/showthread.ph...=1#post1219546
Cheers
"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
I have currently set the parameters via excel vba as follow, I was thinking that there would be a way I can add one line at the end to just save them to the layout.
Code:Dim AcadApp As AcadApplication AcadApp.ActiveDocument.ActiveLayout.ConfigName = "DWG To PDF.pc3" AcadApp.ActiveDocument.ActiveLayout.RefreshPlotDeviceInfo AcadApp.ActiveDocument.ActiveLayout.PlotRotation = ac90degrees AcadApp.ActiveDocument.ActiveLayout.UseStandardScale = False AcadApp.ActiveDocument.ActiveLayout.StandardScale = ac1_1 'ect. AcadApp.ActiveDocument.Plot.NumberOfCopies = 1 AcadApp.ActiveDocument.Plot.PlotToDevice 'Is there something like AcadApp.ActiveDocument.Plot.Save ?
I might be understanding you now, otherwise please let me know (sorry I am not strong in either Autocad or Coding). Are you referring to the "-Plot" command in Autocad? I will need to send command in order to do what i want?
Code:AcadApp.ActiveDocument.SendCommand -plot 'ect. cadApp.ActiveDocument.SendCommand y ' Save changes to page setup [Yes/No]? <N> Y
You've made changes to the active Layout's page setup. Which is fine. You could also use the layout's CopyFrom method.
If you wanted to make changes to a page setup/PlotConfiguration, you would do it to a PlotConfigurations(item) and then use the Layout.CopyFrom method to make it active.Code:AcadApp.ActiveDocument.ActiveLayout.CopyFrom AcadApp.ActiveDocument.PlotConfigurations (itemName)