Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP help: Burst

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
gccdaemon
3921 Views, 19 Replies

LISP help: Burst

So I know that the burst command is a pain to work with in LISP, but here is my dilemma, and I pretty sure someone out there knows how to do this. I need a custom burst routine (doesn't have to be called burst). Here is what I need it to do:

 

1. burst blocks & inserts (essentially all items the ACET burst command would)

2. not keep hidden attributes (like Lee Mac's "burstugraded" routine does)

3. allow for selection set arguments for integration into other lisp routines [ex. (C:BBURST "ALL" "") or (C:BBURST (ssget x '(0 . "BLOCK)) "") , etc.]

4. objects take on properties of their parent blocks (linetype, lineweight, color, etc.)

 

I know Lee Mac's version is good, but it doesn't burst everything. Also, it doesn't allow for selection arguments for LISP integration.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
19 REPLIES 19
Message 2 of 20
bhull1985
in reply to: gccdaemon

For single blocks that you're going to burst you can do this:

 

(defun c:buCV (/ pfst ss)
  (if (setq ss (ssget "_x" '((0 . "INSERT")(2 . "AS-LCON-038"))))
    (progn
      (setq pfst (getvar 'PICKFIRST))
      (setvar 'PICKFIRST 1)
      (sssetfirst nil ss)
      (c:burst)
      (setvar 'PICKFIRST pfst)
    );; progn
    )
 (princ)
 );; burev

 

and call it like this:

(defun rightloop ( ip / )
(cvSub "AS-LCON-039" 1.0875 -1.0875 insertpt1)
(C:BUCVV)
(PRINC)
);DEFUN

 

 

this is some modular stuff i use but i think you can figure out what's going on.

You can just supply the ssget with a variable block name given as an argument if you'd rather it that way.

 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 3 of 20
gccdaemon
in reply to: bhull1985

There are a few problems with that method. The biggest one being that the regular burst command throws hidden attribute text into the drawing. Let me explain a little farther what I'm looking for.

 

When you run the burst routine it prompts the user to select objects. In a macro form, the user could do this by adding "BURST;ALL;;" to a button. I need to utilize this selection using arguments in lisp. To do this I have to modify the existing burst routine to have this selection set argument available to me when I call the command in LISP.

 

[example: (c:newburst "all" "")]

 

In additon to the arguments, I also need the burst routine modified to throw out (remove) blank and hidden attribute definitions. I need this functionality to prevent little text pieces show up that weren't visible before.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 4 of 20
hmsilva
in reply to: gccdaemon

Andrew,
using Brandon's example to call the burst command, you can use the same method to call the Lee Mac's BurstUpgraded routine (assuming that the routine is already loaded), using the function command name (c:iburst)

HTH
Henrique

EESignature

Message 5 of 20
Lee_Mac
in reply to: gccdaemon


@gccdaemon wrote:

I know Lee Mac's version is good, but it doesn't burst everything. Also, it doesn't allow for selection arguments for LISP integration.


 

I will look to modify my program to accept a selection set argument (this is a relatively simple modification), however, I am curious to know what you mean when you say 'but it doesn't burst everything' - could you possibly elaborate so that I might fix any issues with the program to improve it?

 

Lee

Message 6 of 20
gccdaemon
in reply to: Lee_Mac

It does burst blocks with attributes, but it doesn't burst non-attributed blocks. From my limited knowledge, I think you have it set to filter (0 . "INSERT") but not (0 . "BLOCK")? I'm not sure what other objects the regular burst command does. The key for using burst on regular blocks instead of explode is because burst sets the objects in the block to match property overrides on the block definition.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 7 of 20
3wood
in reply to: gccdaemon

You can try EXPLODEALL, which does all you need except it dosen't inherit parent block's linetype & lineweight.

 

 

Message 8 of 20
gccdaemon
in reply to: gccdaemon

I have to have the objects take on the block properties. The regular Burst command would be better than explodeall or explode, except the Burst command doesn't do everything I need it to do. That's why I'm asking for help to change the existing burst command or write a new one.

 

I have about 150 files I'm working with. Each has a couple of attributed blocks (titleblock, etc.) and a slew of basic blocks (Standard note blocks, etc.). Some of the attributed blocks have a dozen or more "Hidden" attributes that have been filled out. I need the revised command to extract the text from "Visible" attributes and ignore/delete the "Invisible" attributes. I also can't figgure out how to change original BURST command selection prompt or how to automate it's object selection.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 9 of 20
gccdaemon
in reply to: gccdaemon

I figgured out a work around. This is a combination of Lee Mac's IBURST routine and the default BURST routine. Instead of comming up with a command that has both functionalities, I just used both commands. Who knew it could have been so simple? lol. Here is the code I have currently, but if someone would modify it so that it checks for imbeded blocks, please post the revision and I'll give you the solution.

 

(defun C:BURSTALL (/ BLKA BLKB PF YN)
	(setq PF (getvar "PICKFIRST"))
	(setvar "PICKFIRST" 1)
	(initget "Yes No")
	(setq YN (getkword "\nBurst all blocks? [Yes/No](No): "))
	(IF (= "Yes" YN)
		(progn (setq BLKA (ssget "X" '((-4 . "<or") (0 . "BLOCK") (0 . "INSERT") (-4 . "or>"))))
			  (sssetfirst nil BLKA)
			  (C:IBURST)
	)	)
	(while (= "Yes" YN)
		 (setq BLKB (ssget "X" '((-4 . "<or") (0 . "BLOCK") (0 . "INSERT") (-4 . "or>"))))
		 (sssetfirst nil BLKB)
		 (C:BURST)
		 (setq YN nil))
	(setq YN nil)
	(setvar "PICKFIRST" PF)
	(princ "\nCommand: Done")
	(princ)
)

 

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 10 of 20
Lee_Mac
in reply to: Lee_Mac


@Lee_Mac wrote:

@gccdaemon wrote:

I know Lee Mac's version is good, but it doesn't burst everything. Also, it doesn't allow for selection arguments for LISP integration.


I will look to modify my program to accept a selection set argument (this is a relatively simple modification), however, I am curious to know what you mean when you say 'but it doesn't burst everything' - could you possibly elaborate so that I might fix any issues with the program to improve it?


I finally got around to updating this program - you can download Version 1.2 here.

 

Using the new version, your program can become:

 

(defun c:burstall nil
    (LM:burst (ssget "_X" '((0 . "INSERT"))))
)

 

Lee

Message 11 of 20
msarqui
in reply to: Lee_Mac

Hello Lee,

 

I have used your routine since the first version and it really burst everything. Now I would like to suggest an improvement. Unlike the original autocad Burst, your routine changes the draworder of the hatches in some blocks. I attached two of my blocks for you to analyze. In this 2 blocks, when I do Burst, the hatch does not change the draworder, but when I do Iburst the hatch of block 2 comes up.

 

Thanks!

Message 12 of 20
gccdaemon
in reply to: msarqui

You could just add the HATCHTOBACK command to the end of the routine as an easy fix.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 13 of 20
msarqui
in reply to: gccdaemon

Hello gccdaemon,

 

Your solution does not work for me. The hatchs that I use are there to hide some things. If at the end I put them to back, those things will be visible and I do not want that.

Message 14 of 20
Lamtech
in reply to: Lee_Mac

Hello again,

 

The lisp you wrote is working flawlessly apart from one small issue that I cannot quite understand.

 

If the lisp is run on a block that has attributed text within various visibilities everything not visible deletes does as it should. If a spell check is run after the burst lisp the so called deleted text re-appears. It is as though the attributed text still resides in the drawings memory. Purging the drawing does nothing to help.

 

All I have told people to do is to run a spell check before using burst.

 

Cheers

 

Freely

Message 15 of 20
gccdaemon
in reply to: Lamtech

All this routine does is collect the blocks and run the ACAD Burst command on them. You may be experiencing a regen problem, or you may need to run an audit after running the routine. I'm positive this isn't related to my routine. Test it by running the regular burst command on a couple of those troublesome blocks.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 16 of 20
Lamtech
in reply to: gccdaemon

Hi, thankyou for getting back to me.

 

I have attached a small drawing with one of the attributed visibility blocks I have created.

I have ran through bouth bursts with audit command after each, finding no errors.

 

  • The regular burst was applied resulting in the 2nd destination that was turned off with the visibility re-appearing.

 

  • The next was the result of new burst and works exactly the way it needs to.

 

  • Finally the new busrt was appied resulting as above but when a spell check is also applied the 2nd destination re-appears. It is like as if it has its own invisible hidden layer within the drawing but no other layers are present.

 

Auditing Tables


Auditing Entities Pass 1

Pass 1 800     objects audited
Auditing Entities Pass 2

Pass 2 800     objects audited
Auditing Blocks

 2       Blocks audited

 

Auditing AcDsRecords


Total errors found 0 fixed 0

Erased 0 objects

 

I am not blaming the routine you created as it works perfectly and I am very greatful you took the time to create it for me. I am just trying to understand where this so-called delete text is able to re-appear (Undo does not do anything once the text has appeared).

 

Its just piece of mind as drawing will be sent to clients, if they edit and run a spell check it will mess up.

 

Hope you or anyone can identify this weird result.

 

Thx

Message 17 of 20
gccdaemon
in reply to: Lamtech

O.k. Did some testing with varying burst routines. All of them resulted in the text showing after spell check, and regular burst showed the hidden items straight out of the routine.

 

What appears to be the issue is the view state inside the dynamic block. What I think is happening is when burst is processing the exploding of the block, the attribute definitions are not being synchronized (attsync) allowing the defined attributes to remain in the block. The burst routine applies the conversion of the attributes to text, but due to the view state the text has a "fault" and is not displayed until spellcheck runs through the document and clears the "fault" and displays the text. You'll notice the line work disappears and never gets restored which further proves my hypothesis.

 

In layman's terms, because of the attributes being in different view states, Autodesk's poorly written code is causing your problem. This is something that may need to be reported as a software glitch.

 

If anyone out there who is better at programming can chime in, let me know if you're getting the same results, or can trace down the source of the problem.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 18 of 20
Lamtech
in reply to: gccdaemon

Oh my don't I feel silly... I didn't actually ask anyone for help with the burst issue I was having, instead I edited one of Lee Mac's great routines to burst everything including nested imbedded elements ...Sorry for hyjacking this thread.

 

Although same conclusion.

 

By any chance is this fixed in the 2017 version of AutoCAD as we upgrade all 10 of our machines next month?

Message 19 of 20
daity8123
in reply to: Lamtech

Hi Mr. Lee Mac,

I have tried your BurstUpgradedV1-7, it runs properly when it was download from VLIDE. Once it is compiled as FAS and VLX, the routine "LM:burstobject" goes into a dead loop, the AutoCAD keeps running and cannot proceed. Could you look into it?

Message 20 of 20
dlanorh
in reply to: daity8123

IIRC Lee designs his lisps so they cannot be run if compiled.

I am not one of the robots you're looking for

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

Post to forums  

Autodesk Design & Make Report

”Boost