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

DXF Code 330

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
2002 Views, 4 Replies

DXF Code 330

In AutoCAD R14.01 I had a lisp routine that utilized dxf code 330 with
hatches to determine what the boundary entity is (I'm using regions as
boudaries in this routine).
I've since moved to R2000i, with non-associative hatching, and I'm finding
that group code 330 is not giving me the same information. It seems to be
refering to some non graphical entity "BLOCK_RECORD".
I'm trying to figure out a way to once again determine the boundary entity
with lisp code.

I don't use associative hatching because that would mess up general drafting
practices in the office.

Thanks for any help.

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

In 2K+ the first 330 is the object's owner. Try this...

;;------------------------------------------------------------
;; Function to determine if an object (specifically of etype, which is a
string)
;; is attached by standard ACAD_REACTORS to the input object:
;; added 04-12-00
;;
(defun @cv_attached? (e etype / ent react ref)
(setq ent (entget e))
(and (setq react (member '(102 . "{ACAD_REACTORS") ent))
(setq ref (nth 1 react))
(= (car ref) 330)
(setq ref (cdr ref))
(setq ent (entget ref))
(= (cdr (assoc 0 ent)) etype)
)
)

Example:
(setq e (car (entsel)))
(@cv_attached? e "HATCH") returns either T or nil

You could modify it to return the attached entity name...
(defun @get_attached (e etype / ent react ref)
(setq ent (entget e))
(if
(and (setq react (member '(102 . "{ACAD_REACTORS") ent))
(setq ref (nth 1 react))
(= (car ref) 330)
(setq ref (cdr ref))
(setq ent (entget ref))
(= (cdr (assoc 0 ent)) etype)
)
ref
)
)

--
John Uhden, Cadlantic/formerly CADvantage
--> mailto:juhden@cadlantic.com
--> http://www.cadlantic.com
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711
FAX 732-528-1332

"Edward Bagby" wrote in message
news:91C5CD8CEB53ADBA0B7D014FF4A162C3@in.WebX.maYIadrTaRb...
> In AutoCAD R14.01 I had a lisp routine that utilized dxf code 330 with
> hatches to determine what the boundary entity is (I'm using regions as
> boudaries in this routine).
> I've since moved to R2000i, with non-associative hatching, and I'm finding
> that group code 330 is not giving me the same information. It seems to be
> refering to some non graphical entity "BLOCK_RECORD".
> I'm trying to figure out a way to once again determine the boundary entity
> with lisp code.
>
> I don't use associative hatching because that would mess up general
drafting
> practices in the office.
>
> Thanks for any help.
>
> Edward
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

Below are the group codes for a hatch object. The first code 330, I'm not
sure what this represents. However, the second code 330... (330 .
name: 40032130>) ...Is the associated region object, which I am trying to
access.

I use... (setq getx (cdr (assoc 330 (entget (ssname vergetdxf 0))))) ... to
access the entity name but it always returns the first 330 entity and not
the second. How do I access the second?

((-1 . ) (0 . "HATCH") (330 .
4008ecf8>)
(5 . "9F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
"AcDbHatch") (10 0.0 0.0 0.0) (210 0.0 0.0 1.0) (2 . "ANSI31") (70 . 0) (71
.
1) (91 . 1) (92 . 1) (93 . 4) (72 . 1) (10 23.3562 3.37284 0.0) (11 25.0247
3.37284 0.0) (72 . 1) (10 25.0247 3.37284 0.0) (11 25.0247 4.90168 0.0) (72
.
1) (10 25.0247 4.90168 0.0) (11 23.3562 4.90168 0.0) (72 . 1) (10 23.3562
4.90168 0.0) (11 23.3562 3.37284 0.0) (97 . 1) (330 .
40032130>)
(75 . 0) (76 . 1) (52 . 0.0) (41 . 1.0) (77 . 0) (78 . 1) (53 . 0.785398)
(43 .
0.0) (44 . 0.0) (45 . -0.0883883) (46 . 0.0883883) (79 . 0) (98 . 1) (10 0.0
0.0 0.0))


Thank you,

Edward
Message 4 of 5
Anonymous
in reply to: Anonymous

Below are the group codes for a hatch object. The first code 330, I'm not
sure what this represents. However, the second code 330... (330 .
name: 40032130>) ...Is the associated region object, which I am trying to
access.

I use... (setq getx (cdr (assoc 330 (entget (ssname vergetdxf 0))))) ... to
access the entity name but it always returns the first 330 entity and not
the second. How do I access the second?

((-1 . ) (0 . "HATCH") (330 .
4008ecf8>)(5 . "9F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0")
(100 .
"AcDbHatch") (10 0.0 0.0 0.0) (210 0.0 0.0 1.0) (2 . "ANSI31") (70 . 0) (71
. 1) (91 . 1) (92 . 1) (93 . 4) (72 . 1) (10 23.3562 3.37284 0.0) (11
25.0247
3.37284 0.0) (72 . 1) (10 25.0247 3.37284 0.0) (11 25.0247 4.90168 0.0) (72
. 1) (10 25.0247 4.90168 0.0) (11 23.3562 4.90168 0.0) (72 . 1) (10 23.3562
4.90168 0.0) (11 23.3562 3.37284 0.0) (97 . 1) (330 .
40032130>)(75 . 0) (76 . 1) (52 . 0.0) (41 . 1.0) (77 . 0) (78 . 1) (53 .
0.785398)(43 .
0.0) (44 . 0.0) (45 . -0.0883883) (46 . 0.0883883) (79 . 0) (98 . 1) (10 0.0
0.0 0.0))

Thank you,
Edward
Message 5 of 5
Anonymous
in reply to: Anonymous

Sorry I misunderstood the question. Presuming (setq ent (entget ...)), try
(assoc 330 (reverse ent)).

--
John Uhden, Cadlantic/formerly CADvantage
--> mailto:juhden@cadlantic.com
--> http://www.cadlantic.com
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711
FAX 732-528-1332

"Edward Bagby" wrote in message
news:4A7D32659ACC9B67947326D170E5F947@in.WebX.maYIadrTaRb...
> Below are the group codes for a hatch object. The first code 330, I'm not
> sure what this represents. However, the second code 330... (330 .
> name: 40032130>) ...Is the associated region object, which I am trying to
> access.
>
> I use... (setq getx (cdr (assoc 330 (entget (ssname vergetdxf 0))))) ...
to
> access the entity name but it always returns the first 330 entity and not
> the second. How do I access the second?
>
> ((-1 . ) (0 . "HATCH") (330 .
> 4008ecf8>)
> (5 . "9F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
> "AcDbHatch") (10 0.0 0.0 0.0) (210 0.0 0.0 1.0) (2 . "ANSI31") (70 . 0)
(71
> .
> 1) (91 . 1) (92 . 1) (93 . 4) (72 . 1) (10 23.3562 3.37284 0.0) (11
25.0247
> 3.37284 0.0) (72 . 1) (10 25.0247 3.37284 0.0) (11 25.0247 4.90168 0.0)
(72
> .
> 1) (10 25.0247 4.90168 0.0) (11 23.3562 4.90168 0.0) (72 . 1) (10 23.3562
> 4.90168 0.0) (11 23.3562 3.37284 0.0) (97 . 1) (330 .
> 40032130>)
> (75 . 0) (76 . 1) (52 . 0.0) (41 . 1.0) (77 . 0) (78 . 1) (53 . 0.785398)
> (43 .
> 0.0) (44 . 0.0) (45 . -0.0883883) (46 . 0.0883883) (79 . 0) (98 . 1) (10
0.0
> 0.0 0.0))
>
>
> Thank you,
>
> Edward
>
>

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

Post to forums  

Autodesk Design & Make Report

”Boost