本帖最后由 tzbm123456 于 2019-7-13 21:03 编辑
Class: Layout:ocument Inherits: Object Overview This is the interface to a LayOut document. A Document is the 2D drawing that the user is working with, and it serves as the “entry point” for most Ruby API interactions. The Document.open method gives you a handle to a Document, and from there you can use the document-level methods to start getting information and making changes. Examples: # Grab a handle to an existing LayOut document. doc = Layout:ocument.open("C:/path/to/document.layout") # Grab other handles to commonly used collections inside the model. layers = doc.layers pages = doc.pages entities = doc.shared_entities # Now that we have our handles, we can start pulling objects and making # method calls that are useful. first_entity = entities[0] number_pages = pages.count Version: LayOut 2018 Constant Summary # Layout:ocument::VERSION_1 Layout:ocument::VERSION_2 Layout:ocument::VERSION_3 Layout:ocument::VERSION_2013 Layout:ocument::VERSION_2014 Layout:ocument::VERSION_2015 Layout:ocument::VERSION_2016 Layout:ocument::VERSION_2017 Layout::Document::VERSION_2018 Layout::Document::VERSION_2019 Layout::Document::VERSION_CURRENT Layout::Document::FRACTIONAL_INCHES Layout::Document::DECIMAL_INCHES Layout::Document::DECIMAL_FEET Layout::Document::DECIMAL_MILLIMETERS Layout::Document::DECIMAL_CENTIMETERS Layout::Document::DECIMAL_METERS Layout::Document::DECIMAL_POINTS ◆Class Method Summary # .open(path) ⇒ Layout::Document The Document.open method creates a new Document by loading an existing .layout file. ◆Instance Method Summary # #==(other) ⇒ Boolean The #== method checks to see if the two Documents are equal. #add_entity(*args) ⇒ Object The #add_entity method adds an Entity to the Document and places it on the given Layer and Page. #auto_text_definitions ⇒ Layout::AutoTextDefinitions The #auto_text_definitions method returns an array of AutoTextDefinition's in the Document. #grid ⇒ Layout::Grid The #grid method returns the Grid for a Document. #grid_snap_enabled=(enabled) ⇒ Object The #grid_snap_enabled= method sets whether or not grid snap is enabled in the Document. #grid_snap_enabled? ⇒ Boolean The #grid_snap_enabled? method returns whether or not grid snap is enabled in the Document. #initialize(*args) ⇒ Object constructor The #initialize method creates a new Document. #layers ⇒ Layout:ayers The #layers method returns the Layers of the Document. #object_snap_enabled=(enabled) ⇒ Object The #object_snap_enabled= method enables or disables inference in the Document. #object_snap_enabled? ⇒ Boolean The #object_snap_enabled? method returns whether or not inference is enabled in the Document. #page_info ⇒ Layout:ageInfo The #page_info method returns a reference to the PageInfo settings of the Document. #pages ⇒ Layout:ages The #pages method returns the Pages of the Document. #path ⇒ String The #path method returns the full path of the Document file. #precision ⇒ Float The #precision method returns the precision for the Document. #precision=(precision) ⇒ Object The #precision= method sets the precision for the Document. #remove_entity(entity) ⇒ Object The #remove_entity method removes an Entity from the Document. #save(*args) ⇒ Object The #save method saves the Document to a file at the given path. #shared_entities ⇒ Layout::Entities The #shared_entities method returns the Entities that exist on shared Layers in the Document. #time_created ⇒ Time The #time_created method returns the time when the Document was created. #time_modified ⇒ Time The #time_modified method returns the last time the Document was modified. #time_published ⇒ Time The #time_published method returns the time when the Document was published. #units ⇒ Integer The #units method returns the units for the Document. #units=(units_format) ⇒ Object The #units= method sets the units for the Document.
|