Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deduce 3d shape name of selected entity + export JSON data #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions skp2ocli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# OGREE TOOL: Sketchup to OGREE Converter Plugin

This is a guide for the plugin OGREE Converter for Sketchup PRO 2023

- [OGREE TOOL: Sketchup to OGREE Converter Plugin](#ogree-tool-sketchup-to-ogree-converter-plugin)
- [Usage](#usage)
- [Compile](#compile)
- [Installation](#installation)
- [Remove](#remove)
- [Code details?](#code-details)


## Usage
After installing the plugin, you simply:
* Select the entity that you want to know its details
* Open the drop down menu **Extension** and click **Generate OCLI files** like shown in the image below
![first step usage](./img/usage-1.png)

## Compile
The plugin is written in Ruby, but in order for plugins to be registrable in Sketchup PRO 2023, you **must** compile the code to a **.rbz** compressed file.

To do that, you must :
1. Create a **.zip** compressed file that contains all the **.rb** files of the plugin
2. Change the compressed file extension to **.rbz**

*Optional*: You can use the batch script below to automate the compilation of the plugin
```bash
@echo off

rem Define the directory to zip, a directory that contains the implementation of the plugin
set "dir_to_zip=skp2ocli"

rem Define the file to include, a file that contains the declaration and metadata of the plugins
set "file_to_include=skp2ocli.rb"

rem Build the zip file
set "zip_name=skp2ocli.zip"
if exist "skp2ocli.rbz" (
del /q "skp2ocli.rbz"
echo Deleted existing zip file: skp2ocli.rbz
)
PowerShell -ExecutionPolicy Bypass -NoProfile -Command "& { Compress-Archive -Path %dir_to_zip%* -DestinationPath %zip_name%}"echo Created zip file: %zip_name%
rem Rename the temporary zip to the desired name
ren "%zip_name%" "skp2ocli.rbz"

echo renamed zip file: skp2ocli.rbz

pause
```

*NB*: The output file will be saved in the directory where the script was executed

## Installation
1. You must click on Extension in the menu
![first step](./img/installation-1.png)
2. From the dropdown menu, click Extension Manager
![second step](./img/installation-2.png)
3. From the new windows that pops up, click on Install Extension
![third step](./img/installation-3.png)



## Remove
To remove the plugin, simply follow the steps below
1. You must click on Extension in the menu
![first step](./img/installation-1.png)
2. From the dropdown menu, click Extension Manager
![second step](./img/installation-2.png)
3. Click on Manage to change tab
![third step](./img/remove-3.png)

## Code details?
To get details about the code you can check directly the source code which is well documented and you can also check directory **[html page](./doc/index.html)** which contains a webpage that document the different functions and classes implemented.
24 changes: 24 additions & 0 deletions skp2ocli/create_rbz.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@echo off

rem Define the directory to zip (replace "mydirectory" with your actual directory)
set "dir_to_zip=skp2ocli"

rem Define the file to include (replace "myfile.txt" with your actual filename)
set "file_to_include=skp2ocli.rb"

rem Get the current directory (where the script is executed)
set "script_dir=%~dp0"

rem Build the zip filename based on directory name and timestamp
set "zip_name=skp2ocli.zip"
if exist "skp2ocli.rbz" (
del /q "skp2ocli.rbz"
echo Deleted existing zip file: skp2ocli.rbz
)
PowerShell -ExecutionPolicy Bypass -NoProfile -Command "& { Compress-Archive -Path %dir_to_zip%* -DestinationPath %zip_name%}"echo Created zip file: %zip_name%
rem Rename the temporary zip to the desired name
ren "%zip_name%" "skp2ocli.rbz"

echo renamed zip file: skp2ocli.rbz

pause
91 changes: 91 additions & 0 deletions skp2ocli/doc/Skp2ocli.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>module Skp2ocli - RDoc Documentation</title>

<script type="text/javascript">
var rdoc_rel_prefix = "./";
var index_rel_prefix = "./";
</script>

<script src="./js/navigation.js" defer></script>
<script src="./js/search.js" defer></script>
<script src="./js/search_index.js" defer></script>
<script src="./js/searcher.js" defer></script>
<script src="./js/darkfish.js" defer></script>

<link href="./css/fonts.css" rel="stylesheet">
<link href="./css/rdoc.css" rel="stylesheet">


<body id="top" role="document" class="module">
<nav role="navigation">
<div id="project-navigation">
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
<h2>
<a href="./index.html" rel="home">Home</a>
</h2>

<div id="table-of-contents-navigation">
<a href="./table_of_contents.html#pages">Pages</a>
<a href="./table_of_contents.html#classes">Classes</a>
<a href="./table_of_contents.html#methods">Methods</a>
</div>
</div>

<div id="search-section" role="search" class="project-section initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<div id="search-field-wrapper">
<input id="search-field" role="combobox" aria-label="Search"
aria-autocomplete="list" aria-controls="search-results"
type="text" name="search" placeholder="Search" spellcheck="false"
title="Type to search, Up and Down to navigate, Enter to load">
</div>

<ul id="search-results" aria-label="Search Results"
aria-busy="false" aria-expanded="false"
aria-atomic="false" class="initially-hidden"></ul>
</form>
</div>

</div>



<div id="class-metadata">





</div>
</nav>

<main role="main" aria-labelledby="module-Skp2ocli">
<h1 id="module-Skp2ocli" class="module">
module Skp2ocli
</h1>

<section class="description">

</section>

<section id="5Buntitled-5D" class="documentation-section">





</section>
</main>


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.5.0.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>

Loading