Hello all,
I have attached a simple AutoCAD Intent 2013 project which adds "Laylout" tabs (DrawingSheet) to an open DWG. There are two Layouts, each of which is being passed one of two Spheres (the only geometry Parts in the DWG).
I have added a Root level "RenderLayouts" rule to add both Layouts to the DWG, by way of their "RenderLayout" rules. There is also a Root level parameter which controls whether the Layouts are creating a "ViewPort" child or not.
Problem 1:
First, open the root parameters and check the "show_parts" option. You will notice that each myDrawingSheet part now has a "ViewPort" child, and the "ViewParts" rule of each one contains one of the two Spheres.
Now, try evaluating the "root.RenderLayouts" rule, which should add the Layout Tabs to the AutoCAD session.
You should get an error that says "Layout does not exist"
Now, go back to root parameters and uncheck (or Restore Default) to the "show_parts" parameter, and re-evaluate "root.RenderLayouts"... this time it will work, but, of course, you won't see any Parts in the layouts since the ViewPort child is not being created.
Now that the Layouts exist, re-check the "show_parts" parameter, and re-evaluate the "root.RenderLayouts"... each Layout will now show Parts.
Question
It seems like this would force 2 evaluations of "RenderLayouts"... the first to create the Layout before any Parts have been specified, and then again to re-render after the "viewparts" input has been established. Is there any way to make this work in one go?
Problem 2:
Now that each Layout shows geometry, you will notice that "layout_left" shows and autofits to the left Sphere (the apricot one), but it also shows the portion of the right sphere (blue) that fits within the ViewPort. The "layout_right" is similar, but WRT to the right Sphere (see sshot.png in the attached ZIP).
Question
Shouldn't each Viewport show only the Parts (a single Sphere) in it's "viewParts" list? Is there any way to make this work? The only documentation I could find indicates that each Layout should show only the Parts passed in.
Can you see anything I'm doing wrong in either case?
It seems some issues here which I can also reproduce in my side, has submitted to our interanl tracking system for investigation.
Thanks,
Amanda
Jon: There is no defect here (technically).
On item #1: Creation of layouts is controlled by the AllLayouts rule at the root. The following line should generate layouts without errors:
Rule AllLayouts As List = {layout_left, layout_right}
On item #2: It’s required that part(s) should be on a unique layer, to make the viewparts rule (of viewport) work correctly. So the issue can be fixed by placing entities on unique layers:
Child Sphere_left As :Sphere
color = "apricot"
radius = 2.5
center = Point(7-2.5,4.25,0)
layer = "left"
End Child
Child Sphere_right As :Sphere
color = "blue"
radius = 2.5
center = Point(7+2.5,4.25,0)
layer = "right"
End Child
Thanks to Eugene Rymski for looking at this. If you have further issues, let us know.
--Jack Gregory