Jump to content

Writing DXF Files problem with ELLIPSE Entities


Recommended Posts

Posted (edited)

Folks I am a newbie to this forum.

 

I have been developing Power Basic code for 2 years now to produce .dxf files.

 

I view these files with DWG View or Autocad Lite. The general type of drawings are schematics or P & I D's with associated bills of materials, all very straighforward in terms of Lines, Arcs, Circles, Text, Boxes and Symbols made up from these entities. I have been trying for sometime to add Ellipses to my scope and have written what I belive to be the correct code for an ellipse, for example an ellipse with a mojor axis = 20 and an minor axis = 8 centered at X = 75 Y = 75. PB generates this code into the .dxf file. However if I inlcude this ellipse in the file AutoCad L comes up with an error "Invalid or Incoplete DXF input. Drawing discared". If I omit this part of the code then the dxf file opens without any error. I have attached 2 files 88.dxf with no error 89.dxf with an attempt to include an ellipse and a fatal error. ( I'll upload these a soon as I work out how to on this Forum )

 

I'm following "Autocad 2011 DXF Reference" Document dated Feb 2010 from Autodesk.

 

Can any one offer any assistance?

 

I do notice that ELLIPSE coordinates are WCS and CIRCLE coordinates are OCS could this be part of the problem?

 

PRINT #1, 0

PRINT #1, "ELLIPSE"

PRINT #1, 8

PRINT #1, "Valve" 'Layer

PRINT #1, 10 'Centre point X

PRINT #1, 75 'IX

PRINT #1, 20 'Centre point Y

PRINT #1, 75 'IY

PRINT #1, 30 'Centre point Z

PRINT #1, 0

PRINT #1, 11 'X Endpoint of major axis relative to the centre

PRINT #1, 10

PRINT #1, 21

PRINT #1, 4 'Y Endpoint of major axis relative to the centre

PRINT #1, 31

PRINT #1, 0 'Z

PRINT #1 ,40 'Ratio of minor to Major axis

PRINT #1, 0.4 'Ratio of Minor to Major

PRINT #1 ,41 'Start parameter

PRINT #1 ,0

PRINT #1 ,42 'End parameter

PRINT #1 , 6.283185307179586 '(2 *3.14159)

 

This Code produces the following in the faulty .dxf file

 

 

 

0

ELLIPSE

8

Valve

10

75

20

75

30

0

11

10

21

4

31

0

40

.4

41

0

42

6.28318530717959

89.dxf

88.dxf

Edited by Kevin Brown
Attaching 2 Files
Posted

No replies ? Have I posted in the wrong forum ?

Posted

I moved the thread in the AutoLisp forum, let's see if you get some inputs here.

Posted

I don't have a solution, but your DXFs are opened with the message "Opening a Release 12 DXF file." and Release 12 exports ellipses as polylines to DXF files so the ellipse is simply not catered for on input.

 

You may have to mimic a later version of DXF where ellipses are defined as ellipses but (I hope i'm wrong) that comes with the burden of providing the extra cruft needed to comply with the later DXF version's undocumented requirements.

 

Hugh Adamson

www.hatchkit.com.au

Posted (edited)

Hi Thanks Fuccaro and Hugh I appreciate the time you took to help, teamwork I like.

 

OK I've learned that there are many releases of .dxf files.

 

I've probably been blind to the fact that when I have first was able to write these files direct from Power Basic that I was not using Group 100 codes atall

for example :

 

I never used

100 Subclass marker (AcDdText) or

100 Subclass marker (AcDdCircle) etc

 

 

I'd be creating files that had no 100 Group codes for example:

 

0

CIRCLE

8

Layer

10

CX

20

CY

40

VR

 

These files work with Autocad Lite 2012 and continue to work. What I need to do now ( I think ) is to more closely study the later versions of .dxf Reference with for example ELLIPSE and make all ENTITIES work with Group 100 codes. Actually I tried that but have not yet got it to work correctly, at least it opens up the DXF file this time although there is no ELLIPSE. I'll keep you posted on how I get on with this.

Edited by Kevin Brown
Posted

Cutting the code right back to a minimum by trying to create a .dxf file that contains only one ENTITY a piece of TEXT "This is a cad drawing" I get the following warning, so I'll have to look to see what is a class separator.

 

Class separator for class AcDbText expected

Invalid or incomplete DXF input -- drawing discarded.

 

 

I attached a zip file of the Power Basic .exe development program that will produce .dxf files without the group 100 or SubClass Markers. You should be able to view in your cad system or a text editor such as Notepad.

Symbols Developer 2.zip

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...