RF Python Basic_02

** Continuing from Basic_01 .... ** ** Click here for the above ** RF Python Basic_01 http://qiita.com/ts_bros/items/17dd84e550897ed42343


Split on the right_tool  (Split Vertical:Vertical split horizontal:Lateral direction)
The left is chooser

Edit_Layout.PNG

The format that stores the edited layoutData is ... It will be .lay.

You can save and load with load / Save layout.

It can be set in File / Preference / Layout.

Def_LayOut.PNG


Will begin the main subject

-Python Realflow Scripting-

: Not really for Beginner ..... http://www.realflowforum.com/viewforum.php?f=39


That's why ... RF_Python lesson01

Create Null Geometry [Python]

#Create Null
null = scene.addNull();
#SetName 
null.setName("locator");

Create_Null.PNG

Create a Hub [Python]

#Create Null
hub = scene.addHub();

Create a Hub and rename it

#Create Hub
hub = scene.addHub();

Hubname =scene.getDefaultHubName();

scene.message(Hubname);

#Return List HubName
geth = scene.getHubs();

listHub = geth[0];

scene.renameHub(listHub,"Target");

Rename_Hub.PNG

Without using: setName () ... Approach to get Hubgeometry with list and change it with renameHub ()

`Connect Hub and Null`` [Python]

#Create Geometry

hub01 = scene.addHub();
null01 = scene.addNull();

hub02 = scene.addHub();
null02 = scene.addNull();

#setName
null01.setName("Null_A");

null02.setName("Null_B");

#Return List HubName
geth = scene.getHubs();

listHub1 = geth[0];
listHub2 = geth[1];

#RenameHub
hubname01=scene.renameHub(listHub1,"A");
hubname02=scene.renameHub(listHub2,"B");

#Create NodeConection

newhubs = scene.getHubs();

New_hub01 = newhubs[0];
New_hub02 = newhubs[1];

newnodes = scene.getNodes();

New_null01 = newnodes[0];
nullname01 = New_null01.getName();

New_null02 = newnodes[1];
nullname02 = New_null02.getName();

#print node&Hub Name
scene.message("hub="  +New_hub01+New_hub02+"Node="  +nullname01+nullname02);


#Change Conect
scene.addLink(nullname01,New_hub02);
scene.addLink(nullname02,New_hub02);

add_link.PNG

`Delete Hub after creating Null`` [Python]

#Create Null
null01 = scene.addNull();  
null02 = scene.addNull(); 

#get Hubname
Hubs = scene.getHubs();

Hubname = Hubs[0];

#remove Hub
delete = scene.removeHub(Hubname);

delete_Hub.PNG


Create multiple Nulls and modify the Name for each Node [Python] Created with array

array = ['1','2','3','4','5'];


for i in array:
    Null = scene.addNull();
    Null.setName("Blast"+i);

Create_many_Nodes.PNG

iterate =10;

for i in range(0,iterate):
    null = scene.addNull();
    null.setName("Blast"+i);

Created with While

iterate =0;

while iterate<30:
     null = scene.addNull();
    
    iterate = iterate+1;

Since the description of Loop processing of RF_Python seems to be a little different It should be noted

Handle while with care (it will be processed forever .....)

Recommended Posts

RF Python Basic_02
Basic Python writing
Python3 basic grammar
Python basic course (12 functions)
Python I'm also basic
Python basic grammar / algorithm
Python Basic Course (7 Dictionary)
Python basic course (2 Python installation)
[python] class basic methods
Python Basic Course (11 exceptions)
Python3 cheat sheet (basic)
Python basic grammar (miscellaneous)
Python Basic Course (Introduction)
Python basic memorandum part 2
python basic on windows ②
Python basic memo --Part 2
Python basic course (13 classes)
Basic Python command memo
Python basic grammar note (3)
Basic knowledge of Python
OpenCV basic code (python)
Python basic memo --Part 1
python memorandum super basic
Python basic course (8 branches)
Python basic if statement
Python Basic Course (3 Python Execution)
Python Basic --Pandas, Numpy-
Basic Python 3 grammar (some Python iterations)
Python application: Pandas Part 1: Basic
Refactoring Learned in Python (Basic)
Python
BASIC authentication with Python bottle
Python basic dict sort order
Python basic course (10 inclusion notation)
Python Basic Grammar Memo (Part 1)
Python basic grammar (miscellaneous) Memo (3)
Python basic grammar (miscellaneous) Memo (2)
Basic Python grammar for beginners
[Python] [SQLite3] Operate SQLite with Python (Basic)
Basic usage of Python f-string
I learned Python basic grammar
Python basic grammar (miscellaneous) Memo (4)
Python (Python 3.7.7) installation and basic grammar
Python Basic Course (1 What is Python)
Java and Python basic grammar comparison
Scraping with Selenium in Python (Basic)
[Python] Basic knowledge used in AtCoder
Python Basic Course (14 Modules and Packages)
1. Statistics learned with Python 1-1. Basic statistics (Pandas)
Basic grammar of Python3 system (dictionary)
Basic Python operation 2nd: Function (argument)
Python application: data visualization part 1: basic
Basic study of OpenCV with Python
Basic Linear Algebra Learned in Python (Part 1)
Python basic operation 1st: List comprehension notation
Python basics ⑤
python + lottery 6
Python Summary
Built-in python
Python comprehension
Python technique