replace solid or hatch with block

replace solid or hatch with block

mruPRQUJ
Advocate Advocate
515 Views
6 Replies
Message 1 of 7

replace solid or hatch with block

mruPRQUJ
Advocate
Advocate

Hi there,

I am wondering if it is possible to create a Lisp routine to meet the following requirements:

Utilize Block "LEADER" to replace solid with the following properties:

Color: ByLayer
Layer: $$-ANNO-TEXT
Linetype: ByLayer
Lineweight: ByLayer
Thickness: 0

 

Utilize Block "LEADER" to replace hatch with the following properties:

Color: ByLayer
Layer: Layer1
Linetype: ByLayer
Lineweight: 0.05
Thickness: 0

 

Please see attached DWG file, thank you very much in advance!

0 Likes
516 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant

Solids that have those characteristics are quite unlike that Block.  Here, at the top is an insertion of the Block [at scale factors of 1 and rotation of 0, and it includes the arrowhead and the tail part, with the insertion point being the tip of the arrowhead].  Below it are two of your Solids that I made yellow for identification:

Kent1Cooper_0-1708174068427.png

I'm having a really hard time imagining how you would want to replace those Solids with that Block.  There might be some hope of determining the insertion point, if they all have the intended tip at the same entity data entry [those few that I checked do], and from there a rotation, and maybe even scale factors [the Solids are of varying sizes].  But the tail is going to make it nothing like what the Solids do as arrowheads with an Arc.

Likewise, here's the Block placed near a Hatch pattern that meets the qualifications [the brownish part]:

Kent1Cooper_1-1708174433067.png

How would you want to replace that Hatch with that Block?  Where should its insertion point go?  What scales and rotation?  There's no apparent [to me] relationship to anything else in the drawing.to suggest answers.

 

Can you post a before and after drawing?  With only a few instances of the relevant pieces but showing all possible types, and with minimal other things just for context?  We don't need all the other stuff, or the Layout.

Kent Cooper, AIA
Message 3 of 7

mruPRQUJ
Advocate
Advocate

Thank you so much for your quick response. I am sorry I did not say it clearly. Both of them scale is 1, rotation is 0. Insertion point for solid is the tip of the arrowhead, hatch insertion point is Center, It is long weekend, I may not response immediately, thanks again. 🙂

0 Likes
Message 4 of 7

mruPRQUJ
Advocate
Advocate

Hi there,

 

Just want to follow up, is there any update? Please see my previous reply, thanks. 🙂

0 Likes
Message 5 of 7

Kent1Cooper
Consultant
Consultant

@mruPRQUJ wrote:

.... Both of them scale is 1, rotation is 0. Insertion point for solid is the tip of the arrowhead, hatch insertion point is Center, ....


I think you need to think more about what you really want to do.  According to that instruction, you will get results like these, in which I made the replacing Blocks green for identifiability:

Kent1Cooper_0-1708624279201.png

It's especially weird at the "angular dimension" [which as really only 41°, and there is no Note 4 to refer to, if that would explain anything].  Those three at the right replaced the Hatch patterns that met your criteria -- what can they possibly mean, especially those with no leftover outline, that point to nothing?

Kent1Cooper_1-1708624367951.png

Kent1Cooper_2-1708624408314.png

And that's assuming that the "tip of the arrowhead" on the Solids is really always the same entity data entry [the ones I checked had it at the second of the corner definition points, i.e. DXF-code 11 entry, but I doubt you could guarantee that would always be the case].

Kent Cooper, AIA
Message 6 of 7

mruPRQUJ
Advocate
Advocate

I did not often use angular dimension. I will modify the block to see the result. Could you please provide the lisp and let me test it? thanks.

0 Likes
Message 7 of 7

Kent1Cooper
Consultant
Consultant

@mruPRQUJ wrote:

.... Could you please provide the lisp and let me test it? thanks.


No -- I don't have a lisp.  I did those replacements manually just to show the weirdness and to raise the question about what you really want to do.  Even if you modify the Block, there simply must be something different about it than just "Both of them scale is 1, rotation is 0."

Kent Cooper, AIA