Explode with the ACAD EXPLODE Command

Explode with the ACAD EXPLODE Command

Anonymous
Not applicable
1,303 Views
4 Replies
Message 1 of 5

Explode with the ACAD EXPLODE Command

Anonymous
Not applicable
Hi all!


My problem:

I have a DWG File with some AcDbBlockReferences. Every

Blockreference contains of a Polyface Mesh. This Polyface

Mesh has some X-Data with information I want to read.


If I explode the Block with the ACAD EXPLODE Command,

the resulting Polyface Mesh contains the X-Data and

I can read them out.

Now I want to do this automatically with my ARX-App.

If I explode the Block using eplode()-function, I get

a pointer to the Polyface Mesh, but this Entity has

no X-Data saved.


Here is a codesnip:


if(pBlkRef->explode(EntArray) == Acad::eOk){

        if(EntArray.length() <= 0){

                pModelSpace->close();

                pBlkRef->close();

                return(false);

        }

        for(int i = 0; i < EntArray.length(); i++){

                es = pModelSpace->appendAcDbEntity(ObjId,

(AcDbEntity*)EntArray);

                ((AcDbEntity*)EntArray)->close();

                if(es == Acad::eOk)

                        ObjArray.append(ObjId);

        }

        pModelSpace->close();

        pBlkRef->close();

        return(true);

}


Thanks for any help, Markus

0 Likes
1,304 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
AcDbBlockReference::explode() uses
getTransformedCopy() on each entity in the block definition to create the
explode set.  Unfortunately, AcDbPolyFaceMesh::getTransformedCopy() doesn't
copy the xdata to the copy.

 

All I can think of is that you could have your code
find the source polyfacemesh and copy the xdata from it to the polyfacemesh copy
after the explode is complete.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
all!

My problem:
I have a DWG File with some AcDbBlockReferences.
Every
Blockreference contains of a Polyface Mesh. This Polyface
Mesh has
some X-Data with information I want to read.

If I explode the Block with the ACAD EXPLODE Command,
the resulting
Polyface Mesh contains the X-Data and
I can read them out.
Now I want
to do this automatically with my ARX-App.
If I explode the Block using
eplode()-function, I get
a pointer to the Polyface Mesh, but this Entity
has
no X-Data saved.

Here is a codesnip:

if(pBlkRef->explode(EntArray) ==
Acad::eOk){
        if(EntArray.length()
<=
0){
                pModelSpace->close();
                pBlkRef->close();
                return(false);
        }
        for(int
i = 0; i < EntArray.length();
i++){
                es
= pModelSpace->appendAcDbEntity(ObjId,

(AcDbEntity*)EntArray);
                ((AcDbEntity*)EntArray)->close();
                if(es
==
Acad::eOk)
                        ObjArray.append(ObjId);
        }
        pModelSpace->close();
        pBlkRef->close();
        return(true);
}

Thanks for any help, Markus

0 Likes
Message 3 of 5

Anonymous
Not applicable
Hi!
Hi!

Thanks for your help!

> Unfortunately, AcDbPolyFaceMesh::getTransformedCopy() doesn't copy the
> xdata to the copy. All I can think of is that you could have your code
> find the source polyfacemesh and copy the xdata from it to the
> polyfacemesh copy after the explode is complete.

How can I do this? Can you give me a hint or some
documentation?

Markus
0 Likes
Message 4 of 5

Anonymous
Not applicable
You'll have to get the objectId of the AcDbBlockTableRecord that the
blockReference references, then get an interator for that BlockTableRecord
and iterate through its contents looking for the polyfacemesh. Once you've
got the source polyfacemesh object you can use it's xData() method to get
its xdata. You can then use the setXData() method on the copy passing in
the data list you got from the source object's xData() method.

"Markus Griesser" wrote in message
news:AEAC4C6A2C2B4766BF34368C765FA5F8@in.WebX.maYIadrTaRb...
> Hi!
> Hi!
>
> Thanks for your help!
>
> > Unfortunately, AcDbPolyFaceMesh::getTransformedCopy() doesn't copy the
> > xdata to the copy. All I can think of is that you could have your code
> > find the source polyfacemesh and copy the xdata from it to the
> > polyfacemesh copy after the explode is complete.
>
> How can I do this? Can you give me a hint or some
> documentation?
>
> Markus
0 Likes
Message 5 of 5

Anonymous
Not applicable
Hi!

Thanks for your help! It works now...

Markus
0 Likes