[solved]How to execute Purge command from the command line

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
t.ogawa
Junior Member
Posts: 14
Joined: Fri May 03, 2019 4:04 am

[solved]How to execute Purge command from the command line

Post by t.ogawa » Fri May 17, 2019 10:44 am

Hello.

Please tell me how to execute 「purgeblocks」 command from the command line.


input dxf
  ↓
do purgeblocks -> out dxf
  ↓
dwg2pdf
  ↓
output pdf


I want to realize all the above with commands.

thank you.
Last edited by t.ogawa on Mon May 20, 2019 6:10 am, edited 1 time in total.

User avatar
andrew
Site Admin
Posts: 6240
Joined: Fri Mar 30, 2007 6:07 am

Re: How to execute Purge command from the command line

Post by andrew » Fri May 17, 2019 2:51 pm

There is no command line tool in QCAD to do that.

You can create your own script and trigger:

Code: Select all

include("scripts/Pro/Block/PurgeBlocks/PurgeBlocks.js");
...
PurgeBlocks.purgeBlocks(di);
Where di is the document interface.

See also:
https://qcad.org/en/tutorial-command-line-tool-scripts

You'd typically insert PurgeBlocks.purgeBlocks(di); instead lines 66-69.

t.ogawa
Junior Member
Posts: 14
Joined: Fri May 03, 2019 4:04 am

Re: How to execute Purge command from the command line

Post by t.ogawa » Mon May 20, 2019 4:37 am

Hi Andrew.

Thank you for you reply.

The following error was displayed when executing the method taught.

[Command]

Code: Select all

 ./qcad -platform  -no-gui -allow-multiple-instances -autostart qcad_purgeblock.js  -f -o out.dxf in.dxf
[Terminal]

Code: Select all

QCAD version  3.22.0
Fatal:    This application failed to start because it could not find or load the Qt platform plugin "-no-gui"
in "".

Available platform plugins are: cocoa.

Reinstalling the application may fix this problem.
./qcad: line 18: 49991 Abort trap: 6           DYLD_LIBRARY_PATH="$DIR" "$binary" "$@"
 
Do I need to install any additional software?

thank you.

t.ogawa
Junior Member
Posts: 14
Joined: Fri May 03, 2019 4:04 am

Re: How to execute Purge command from the command line

Post by t.ogawa » Mon May 20, 2019 6:09 am

The problem is solved.

It changed when the character code was changed to utf8.
It is probably the same problem as the question being asked.
https://qcad.org/rsforum/viewtopic.php?f=33&t=6280

Thank you for your response.

Post Reply

Return to “QCAD 'How Do I' Questions”