Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcCoreConsole behaves differently when running script

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
2301 Views, 4 Replies

AcCoreConsole behaves differently when running script

Good morning all,

I have run into this problem which I cant figure out. My goal is to loop through a bunch of dwg, save them as dxfs, explode everything in the dxf, and save it once again. I run into a problem when I try to explode everything. If I run accoreconsole with:

C:\Program Files\Autodesk\AutoCAD 2019>accoreconsole.exe /i "C:\Users\Owen Busler\Documents\explodeTest.dwg"

 

I am able to manually select all, explode, and select all again to see that there are more objects and the explode worked. 

Execution Path:
C:\Program Files\Autodesk\AutoCAD 2019\accoreconsole.exe

Version Number: P.46.0.0 (UNICODE)
Regenerating model.

**** System Variable Changed ****
1 of the monitored system variables has changed from the preferred value. Use SYSVARMONITOR command to view changes.
Command:
Command:
Command:
Command: select
Select objects: all
1 found
Select objects:
Command: explode
1 found
Command: select
Select objects: all
12 found

Now, if I put the exact commands I typed in to a script and run it, The explode doesn't seem to do anything. 

Line running the script:

C:\Program Files\Autodesk\AutoCAD 2019>accoreconsole.exe /i "C:\Users\Owen Busler\Documents\explodeTest.dwg" /s "C:\Users\Owen Busler\Documents\ACScript\explode.scr"

Script:

select
all

explode
select
all

 

And the output when the script is ran:

Execution Path:
C:\Program Files\Autodesk\AutoCAD 2019\accoreconsole.exe

Version Number: P.46.0.0 (UNICODE)
Regenerating model.

**** System Variable Changed ****
1 of the monitored system variables has changed from the preferred value. Use SYSVARMONITOR command to view changes.
Command:
Command:
Command:
Command: select
Select objects: all
1 found
Select objects:
Command: explode
Select object:
Command: select
Select objects: all
1 found
Select objects:

It appears that when the script is running explode that it performs a different action. When run manually, the execution of explode says "1 found" saying that it exploded 1 object. When executed by the script it says Select objects: Maybe the script loses the select all before the explode? Any suggestions on how to move forward would be wonderful.

 

Thank you very much!

4 REPLIES 4
Message 2 of 5
cadffm
in reply to: Anonymous

No, it is exactly the same like in you acad.exe - so it isnt "differently in AcCoreConsole".

It is also documented in your help, please read about command EXPLODE - KLICK!

 

It only explode ONE object.

 

Normally I prefer to use a small lisp-loop to explode all,

but you can also set bit0 - QAFLAGES 1

(you should set it back to 0 or 2 every time)

 

 

Sebastian

EESignature

Message 3 of 5
Anonymous
in reply to: cadffm

Im sorry for not explaining well enough. In acad.exe (the gui) Select, all, explode, does indeed work just like it does when manually typing into AcCoreConsole. I selects all objects, and explodes every one possible. However, what behaves different, is when AcCoreConsole is run with a script of select, all, explode. That is when it acts different. 


I should mention I have also tested this with a dwg which contains 1000's of parts and it behaves the same. In acad.exe or in manual AcCoreConsole select, all, explode works as intended, but the script select, all, explode, behaves just as it did in my original post. I also also tried explode, all, but that has been returning "This object can not be exploded" a few thousand times. 

Message 4 of 5
cadffm
in reply to: Anonymous

No, you don't understand and compare the wrong things.

A) In accoreconsole you are starting a script, the result is identical to run this script in AutoCAD.

b) The difference is: Using  explode all manually vs. using in scripts, macros, sendcommands..

So it isn't a special accoreconsole issue.

 

I posted the Link to Explode-Help site, the it is documented.

I also gave you a solution in my answer above.

Test in in AutoCAD before you test it in acc, it is easier for you to check the results.

To start a script inside of Autocad you can use the command SCRIPT

 

""This object can not be exploded"" This is another thing, you should test my solution first (with simple objeects

like polylines or blockreferences. If that works fine and the ""This object can not be exploded"" problem is still there,

we need more informations: DWG, SCR, Version info of your programm (in Acad, command ABOUT, take a screenshot).

 

HTH

 

Sebastian

EESignature

Message 5 of 5
Anonymous
in reply to: cadffm

Thank you so much for pointing me in the right direction. I ended up using xplode. I missed the "explode can only effect one object at a time in script" in the documentation. 

Have a wonderful day good sir!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta