# Generated from lib/autocad/app.rb with RBS::Inline module Windows class FileSystem def self.windows_path: (untyped path) -> untyped # Convert path to windows path # @rbs path: String, Pathname the path you want to convert def windows_path: (String path) -> untyped def fs_object: () -> untyped end end module Autocad class App include Common attr_accessor default_error_proc: untyped def self.default_app_options: () -> untyped def self.debug_error: () -> untyped # save the current drawing # @rbs dir: String|Pathname -- the dir to save drawing to # @rbs exit: bool -- whether to exit afterwards or start irb # @rbs model: bool -- prints model space instead of paperspace in pdf document # @rbs return void def self.save_open_drawings: (?dir: String | Pathname, ?exit: bool, ?model: bool) -> void # Runs the app, opening the filenames # and yielding each open drawing to the # supplied block # it automatically closes the drawing and # the app when done # # [source] # dir = Pathname.new('C:/templates') # drawings = Pathname.glob(dir + '/**/*.dgn') # App.with_drawings(drawings) do |drawing| # drawing.save_as_pdf(dir: 'c:/output/') # end # # @rbs *files: Array[String|Pathname] # @rbs visible: bool -- show the app window # @rbs error_proc: (Exception, Drawing) -> void # @rbs wait_time: Integer -- the total amount of time to wait to open file (500) # @rbs wait_interval: Float -- the amount of time to wait between attempts (0.5) # @rbs read_only: bool # @rbs &: (Drawing) -> void def self.with_drawings: (*Array[String | Pathname] files, ?visible: bool, ?error_proc: untyped, ?wait_time: Integer, ?wait_interval: Float, ?read_only: bool) { (Drawing) -> void } -> untyped # gets all dwg and dgn files in the directory given by # dir_or_file or gets the file given by dir_or_file # and saves them as pdf files in the outdir # @rbs dir_or_file: String the directory of drawing [dgn,dwg] to convert # @rbs outdir: String the output dir for converted pdf files # @rbs return void def self.dwg2pdf: (String dir_or_file, ?outdir: String, ?mode: untyped) -> void # Initialize an instance of app with the options # @rbs : Hash] options the options to create the app with # @option options bool :visible Is the app visible # # [source] # ---- # App.run do |app| # drawing = app.open_drawing('test.dgn') # drawing.scan_all_text do |model,text| # puts "#{model} #{text}" # end # end # @rbs options: Hash[Symbol,Object] # @rbs &: (App) -> void -- the_app yields the instanciated app def self.run: (?Hash[Symbol, Object] options) { (App) -> void } -> void # Calls #run to get an app instance then call open drawing with # that app # (see #open_drawing) # @rbs &block: { (Drawing) -> void } def self.open_drawing: (untyped drawing, **untyped options) ?{ (?) -> untyped } -> void # @rbs return bool -- true if there is an active drawing def active_drawing?: () -> bool # @rbs return Drawing | nil -- returns drawing if active_drawing def active_drawing: () -> (Drawing | nil) def drawing_from_ole: (untyped ole) -> Drawing attr_reader error_proc: untyped attr_reader visible: untyped attr_reader logger: untyped # Constructor for app # @rbs visible: bool -- do you want the app to be visible # @rbs event_handler: EventHandler def initialize: (?visible: bool, ?error_proc: untyped, ?event_handler: EventHandler, ?wait_interval: untyped, ?wait_time: untyped) -> untyped def windows_path: (untyped path) -> untyped def wrap: (untyped item, ?untyped cell) -> untyped # the default EventHandler # # @rbs return EventHandler -- returns the default EventHandler def default_event_handler: () -> EventHandler def default_app_options: () -> untyped # register an handler # # @rbs event: String -- event to registor for def register_handler: (String event) ?{ (?) -> untyped } -> untyped # # return a Handler # # @rbs : String,Symbol] event the event key # # @rbs return Proc returns the Proc given by event name def get_handler: (untyped event) -> Proc def load_constants: (untyped ole) -> untyped def run_loop: () -> untyped def stop_loop: () -> untyped def exit_message_loop: () -> untyped def visible?: () -> untyped def visible=: (untyped value) -> untyped def make_visible: (untyped visible) -> untyped # Zooms the current viewport to display the entire drawing def zoom_all: () -> untyped # Zooms the current viewport to a specific center point and magnify factor # @rbs center: Point3d | [Float, Float, Float| nil] -- center of zoom # @rbs magnify: Float def zoom_center: (Point3d | [ Float, Float, Float | nil ] center, ?magnify: Float) -> untyped def ole_obj: () -> untyped def quit: () -> untyped def close_all_drawings: () -> untyped def close_active_drawing: () -> untyped # create a new drawing # # @rbs filename: String | Pathname -- The name of the drawing. # @rbs seedfile: String -- The name of the seed file. # should not include a path. The default ggextension is ".dgn". # Typical values are "seed2d" or "seed3d". # @rbs open: bool -- If the open argument is True, # CreateDesignFile returns the newly-opened DesignFile object; # this is the same value as ActiveDesignFile. If the Open argument is False, # CreateDesignFile returns Nothing. # @rbs return Drawing, void -- returns the new drawing def new_drawing: (String | Pathname filename, ?open: bool, ?options: untyped) ?{ (?) -> untyped } -> Drawing # open the drawing # @rbs filename: String the name of the file to open # @rbs : bool :read_only (false) # @rbs wait_time: Integer -- the total amount of time to wait to open file (500) # @rbs wait_interval: Float -- the amount of time in seconds to wait before retry (0.5) # @rbs error_proc: Proc -- a proc to run # @rbs &: (Drawing) -> (void) # @rbs return Drawing | void def open_drawing: (String filename, ?read_only: untyped, ?wait_time: Integer, ?wait_interval: Float, ?error_proc: Proc) { (Drawing) -> void } -> (Drawing | void) def model_space: () -> untyped # @rbs message: String -- the String to put in Autocad prompt def prompt: (String message) -> untyped # @rbs prompt: string -- the string to prompt the user for string # @rbs has_spaces: bool -- whether the string returned can contain spaces def get_input_string: () -> untyped # @rbs prompt: string -- the string to prompt the user for integer def get_input_integer: () -> untyped # In a running Autocad instance, prompts the user for a point. # Uses the prompt argument as the prompt string. # If base_point is provided, it is used as the base point and a # stretched line is drawn from the base point to the returned point. # @rbs prompt: String # @rbs base_point: Array, Point3d, nil # @rbs return [Point3d] def get_point: () -> [ Point3d ] # In autocad prompts the user for a selection. # @rbs prompt: String the prompt that displays in Autocad # @rbs name: String the name of the selection # @rbs return [SelectionSet] def get_selection: (?prompt: String, ?name: String) -> [ SelectionSet ] def has_documents?: () -> untyped # @rbs return Enumerator[Drawing] | void # @rbs &: (Drawing) -> void def documents: () { (Drawing) -> void } -> (Enumerator[Drawing] | void) # @rbs return [bool] true def drawing_opened?: () -> [ bool ] # @rbs return [Pathname] Autocad Files.TemplateDwgPath def templates_path: () -> [ Pathname ] def templates: () -> untyped # Set Autocad Files.TemplateDwgPath # @rbs path: Pathname, String the location on disk for Autocad templates def template_path=: (Pathname path) -> untyped # @rbs return [Array] all paths in Files.SupportPath def support_paths: () -> untyped # @rbs return [Array] all paths in Files.PrinterConfigPath def printer_config_paths: () -> untyped # from the printer_config_paths, return all plotcfg files # @rbs return [Enumerator[String]] def plot_configs: () -> [ Enumerator[String] ] private def ole_preferences_files: () -> untyped def send_command: (untyped command) -> untyped def init_ole_and_app_event: (?visible: untyped, ?event_handler: untyped, ?tries: untyped, ?sleep_duration: untyped) -> untyped def doc_ole: () -> untyped def new_ole_drawing: (untyped filename, ?open: untyped, ?wait_time: untyped, ?wait_interval: untyped) -> untyped def ole_open_drawing: (untyped filename, ?read_only: untyped, ?wait_time: untyped, ?wait_interval: untyped) -> untyped def wait_drawing_opened: (untyped secs, ?untyped interval) -> untyped end end