Part 1 explains how to create and execute a .bat file for the external transformation function of Jw_cad.
In Part 2 this time, we will explain the actual movement with REM # ~~~
described in the external transformation file (.bat).
As I mentioned a little in Part 1, it is a command that works only in Jw_cad.
The original meaning is to write REM ~~~
when leaving a comment in the batch file.
It is used as a string that is neither displayed on the screen nor executed.
In Jw_cad, it is said that the command operates in Jw_cad by combining REM
and␣ #
.
REM # ~~~
is explained below.
Command name | Function / operation | Remarks |
---|---|---|
REM ~~~ | Jw_Display name on cad | After REM#Is unnecessary |
REM #jww | JWW format declaration | Can handle block figures, dimension figures, and character fonts. |
REM #jw | JW format declaration | On the contrary to the above, the function is limited. Maybe you don't use it much? |
REM #cd | JWC in the same location as the executable file_TEMP.TXT creation | If not stated, Jw_Created in the folder where cad is installed |
Use the above basic command for hogehoge.bat created in Part 1
hogehoge.bat
@echo off
REM external transformation start(hello world!!)
REM #jww
REM #cd
echo hello world!!
pause >nul
Type the following contents in Notepad, save as and save with range selection.bat
.
Range selection.bat
@echo off
REM range selection
REM #cd
REM #jww
REM #0
call notepad.exe JWC_TEMP.TXT
pause >nul
The difference from hogehoge.bat is that REM # 0
is added on the 5th line and call notepad.exe JWC_TEMP.TXT
is added on the 6th line.
By adding REM # 0
, open the external transformation range selection.bat
and specify the ** No.0 reference point on Jw_cad. ** is displayed, and external transformation is executed based on any point.
call notepad.exe JWC_TEMP.TXT
is a command to open JWC_TEMP.TXT
before the external transformation is finished.
The above screen is a diagram from selection of external transformation to range selection to opening of Notepad.
External transformation → Range selection.bat → Click anywhere → Command prompt is displayed → JWC_TEMP.TXT
opens.
Execute range selection.bat
executed in Operation of [external transformation file], and execute
Display JWC_TEMP.TXT
in Notepad. (Do not touch the command prompt until you save JWC_TEMP.TXT.)
Enter the coordinate data under #
as described in JWC_TEMP.TXT
below.
Also, delete the hq
on the first line of JWC_TEMP.TXT
and save it by overwriting.
If the command prompt remains on the screen, press the appropriate key on the keyboard.
Then, ** Qiita ** with a frame will be written at any point clicked when executing external transformation.
JWC_TEMP.TXT
hk0
~~~~~abridgement~~~~~
#
-125 -40 125 -40
-125 60 125 60
-125 -40 -125 60
125 -40 125 60
cn0 100 100 0 2
ch -125 -40 250 0 "Qiita
The following character string is described in JWC_TEMP.TXT
. (The content changes depending on the environment.)
JWC_TEMP.TXT
hq
hk 0
hs 100 100 100 600 600 100 100 100 100 1 100 100 60 100 1 1
hcw 2 2.5 2.8 3 3.2 2.5 5 7 2 5
hch 2.5 3.2 3.5 3.8 4 2.5 5 7 2 5
hcd 0 0 0.5 0 0.5 0 0 0 0 0
hcc 2 2 2 2 2 2 2 2 8 9
hn -433.572606382979 -313.508776595745 701.030585106383 140.759042553192
lg9
ly0
lc2
lt1
cn0 100 100 0 2
cn"$<MS gothic>
#
-125 -40 125 -40
-125 60 125 60
-125 -40 -125 60
125 -40 125 60
cn0 100 100 0 2
ch -125 -40 250 0 "Qiita
Information (layer, scale, etc.) on CAD data is described in the first line from hq
to#
.
[#【JWC_TEMP.TXT】を編集し図面上へ反映させる。] As I did, by writing the line coordinates and characters + coordinates below #
, the lines and characters are reflected on the drawing.
If hq
in the first line remains, it is considered that the processing is not completed and it is not reflected in the drawing.
Therefore, delete hq
so that it will be reflected in the drawing.
Here, the movement of external deformation is expressed by chewing as follows. ** Press the external transformation command on Jw_cad ** → ** Select external transformation ** → ** Select on Jw_cad (range or point) ** → ** Start command prompt ** → ** Create JWC_TEMP.TXT * * → ** Added / edited / deleted hq to JWC_TEMP.TXT ** → ** Reflected in Jw_cad **.
This time, JWC_TEMP.TXT
was written manually and copied and pasted, but if you process this part with Python, it will surely progress ... work ...
As a foundation for Python to work on this page as well Explained the startup of the external transformation .bat file, the REM command, and JWC_TEMP.TXT. Next, I would like to explain how to get arguments from CAD and pass them to python when executing external transformation. ~~ I'm tired. ~~
Jw_cad page ← This is the official page of Jw_cad. Markdown notation cheat sheet ← I used it as a reference in how to write Qitta. JWW_SMPL.BAT search ← REM command is explained. I was allowed to refer to it.
Recommended Posts