DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Dxf recoloring

Started by Juergen, November 30, 2014, 01:32:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Juergen

The recoloring problem described here http://forum.designcad.com/index.php?topic=6013.0 leads to an unexpected trap.
I've attached a sample dxf-file. Please be so kind and try to recolor this to red. In case someone has success I would be very happy
to know the single steps or to see the macro doing this.

Prl / Madmax - now frozen: I know you can ;)

Kind regards,

Juergen

PS: In order to upload the dxf I have appended a ".txt"

prl

#1
Juergen,  you are creating entities with color ByLayer property and exporting.  Solution for DXF is in graphic. Also attached the fixed dxf. You'll need to remove all the extra extensions.  (I like your trick for attaching the file.)


Juergen

Hey Prl,

thanks for your time! My problem is that I have to work with approximate 10^4 different dxf files - and I am not the producer. My solution was to explode the dxf (described here: http://forum.designcad.com/index.php?topic=6013.0), but DC loves to crash with the third call. The function itself is working fine.

Kind regards,

Juergen

PS: I have the beer in mind. Do you want to send me your home address by pm? No fear - I'm not going to stand at your doorstep. 8)

prl

#3
Juergen, are you creating those drawings?   I looked at your other topic.

Your importing into DC , doing something to them and then sending them back out?  Are they coming in as Blocks?

DesignCAD is full of landmines but sometimes it isn't DesignCAD if you're dealing with an imported dxf.

prl

Juergen, I think I misunderstood what you are asking.

You want to pull in the attached DXF in your original post and recolor it Red in DesignCAD?  Yes?  I thought you had created that drawing and were having troubles exporting it.  I've been dealing with faulty dwg/dxf exports so I was thinking that way.

Juergen

Prl,

please take a look at the first video here http://kneifel.eu/dcc/ (at the very end) or
the third video on the same page or
the video here http://kneifel.eu/dcc/dxf.php (scroll down).

Sorry, it's all in German (and my very first app not provided for additional languages).
The links are not public ('til now ;) ). There you see me just importing some dxf and recoloring
them. That's all what's happening to the dxf. I don't export them, they are only objects to work with.

Kind regards,

Juergen

prl

Quote from: Juergen on November 30, 2014, 06:56:11 AM
Sorry, it's all in German (and my very first app not provided for additional languages).

Not a problem.  In my version of DesignCAD version 26, under options, general tab, I have the Übersetzer/Dolmetscher toggle turned ON.

I also use it to translate English into English.  It helps with the Philosophy debates. ;)

Several jokes in here folks.

Juergen

I guess DC needs a garbage collection after two (explored) dxf recolored. My workaround is now to save and reload the drawing in case two recolered dxf are reached.
Does someone (Prl?) know a more elegant solution to clean up?

Kind regards,

Juergen

PS: Error code after two dxf recolored: "The remote procedure call failed."

QuoteI also use it to translate English into English.  It helps with the Philosophy debates.
;D ;D ;D ;D ;D ;D ;D ;D ;D

prl

Juergen, I haven't had the chance to look into this, maybe tomorrow (Tuesday).

prl

#9
Quote from: Juergen on November 30, 2014, 06:56:11 AM
please take a look at the first video here http://kneifel.eu/dcc/ (at the very end) or
the third video on the same page

VERY NICE!  You're interface is fantastic.  And this is your first programming undertaking?  Please get very wealthy (and buy DesignCAD)!

What is DC doing when you try a third re-coloring?  Ignoring the coloring, crashing, error messages?

Juergen

#10
QuotePlease get very wealthy

I'll do my very best ;)

It's not my first app but my very first app not provided for additional languages.
Most of my apps are designed to be ready for translation - this not. You find some
links here: http://claim.ms/ - And some phone apps:

https://play.google.com/store/apps/details?id=com.AnhaltewegIBK&hl=en
https://itunes.apple.com/en/app/stopping-distance-calculator/id761276061?mt=8

QuoteWhat is DC doing when you try a third re-coloring?  Ignoring the coloring, crashing, error messages?

DC crashes with this error: "The remote procedure call failed."

I am close to a solution right now. I think there is an error in the dll. Now I am trying to write an
macro (live, in runtime with different content, e.g. group name) to be excuted within my app. The macro
groups the dxf and removes colorbylayer. This works fine for now - I am still testing.

Thanks for your time (I still need an pm for the beer :) ).

Juergen

prl

Quote from: Juergen on December 02, 2014, 05:54:24 AM
DC crashes with this error: "The remote procedure call failed."

At times, DesignCAD OLE loses track of objects (pointers).  Purposely reacquire your objects after each modification just in case DesignCAD has resorted the database entity ids and your previously acquired pointer to the object is pointing to nil. 

Not saying this is the answer, but weird things happen.  As you say garbage collection routine may not be doing its thing.

Juergen

QuotePurposely reacquire your objects after each modification

But how?  :(

Juergen

Following a friend's advice I now work with a reserved layer.
This relieves me to work no longer with the faulty dll entries methods.

I think it will work :D . Please don't waste your time with this topic any longer.

Thanks again,

Juergen

prl

#14
Quote from: Juergen on December 02, 2014, 07:44:44 AM
Please don't waste your time with this topic any longer.

Just playing around.  May I ask you attach three of those car dxfs so I can play with the recoloring?  I'll use Delphi.  It is strongly typed and generates useful error messages. 

Oh yes, I'd prefer a sporty BMW, maybe a Mercedes , and a nice Audi.