.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Finding DXF Codes

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
1978 Views, 11 Replies

Finding DXF Codes

How do I find DXF codes for various AutoCAD and Civil 3D entities? is there a command or Utility I can use to drill down into the various entities and find these values? I need this information for building SelectionFilters but can't find a good source.

Thanks,
Josh

Civil 3D 2009 SP1
VS2005 SP1
Win XP Pro SP2
11 REPLIES 11
Message 2 of 12
AdammReilly
in reply to: Anonymous

Attached is a small lisp program, which I modified, and was originally in the LISP Tutorial of the help documentation with AutoCAD.
PrintDXF is the command, run it, select any entity, and it will print the dxf data to the command line. My modification will also print the XData attached to the entity.

Adam Reilly

Dell Precision 55400
Windows 10 Pro
Intel Xeon E-2276M 2.80GHz, 64bit
NVidia Quadro T2000 Mobile/Max-Q


LinkedIn | Twitter


Group Leader badge


Austin CADD User Group


LinkedIn | Discord

Message 3 of 12
AdammReilly
in reply to: Anonymous

Couldn't add file. heres the code:

(defun C:PRINTDXF (/ entl ct xct dct)
(setq entl (entget (cdar (entget (car (entsel "Pick an entity to examine ")))) '("*"))
ct 0)

(princ "\nEntget of selected entity:")
(repeat (if (= (car (last entl)) -3)
(- (length entl) 1)
(length entl)
);_if
(print (nth ct entl))
(setq ct (1+ ct))
);_repeat
(if (= (car (last entl)) -3)
(progn
(print "(-3")
(setq xct 1
dct 0)
(repeat (1- (length (last entl)))
(repeat (length (nth xct (last entl)))
(if (atom (nth dct (nth xct (last entl))))
(princ "\n ")
(princ "\n ")
);_if
(prin1 (nth dct (nth xct (last entl))))
(setq dct (1+ dct))
);_repeat
(setq xct (1+ xct)
dct 0)
);_while
(print ")")
);_progn
);_if
(princ)
);_defun c:PRINTDXF

Adam Reilly

Dell Precision 55400
Windows 10 Pro
Intel Xeon E-2276M 2.80GHz, 64bit
NVidia Quadro T2000 Mobile/Max-Q


LinkedIn | Twitter


Group Leader badge


Austin CADD User Group


LinkedIn | Discord

Message 4 of 12
Jimcao07
in reply to: AdammReilly

Can someone please let me know the command to read/write entity property via dxf index number like this.

Message 5 of 12
Jimcao07
in reply to: Jimcao07

I mean in VB.net
Message 6 of 12
BKSpurgeon
in reply to: Anonymous

Is this what you are looking for (please review attached pdf): DXF references list (full).

 

hope this helps.

 

regards,

 

Ben

Message 7 of 12
Jimcao07
in reply to: BKSpurgeon

Hello BK Thank you. I stored the reference and it's helpful. I'm using vb.net dealing with a customized object (impentity), which stored text associate with dxf code 1, and I can not found the stored text exposed in my vb.net environment via acadobject or others. I found it's so easy to access it in LISP like (print (nth ct entl)), but I don't know how to access the value associated with certain dxf code number in my vb.net program. Thank you.
Message 8 of 12
dgorsman
in reply to: Jimcao07

Thats dependant on how the information is stored.  For example, XRecords use one set of DXF codes (which match standard AutoCAD DXF codes) while XDATA uses its own set of DXF codes.  The actual meaning of the data in both cases is left up to the user to decide its context ie. a coordinate value could be a start point, or end point, or even a vector.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 9 of 12
Jimcao07
in reply to: dgorsman

Hi Dgors

 

I tried dbobject.xdata(retrieved all registered application), and I can get some dxf code value associated with 1000~1005 or so. My issue is like someone said reverse engineering on customized object (IMPEntity). That object stored data associated with dxfcode 1. Now I'm using resultbuffer / ivoke to have a LISP program run and get the value. If vb.net has the same ability like (print (nth ct entl)), as posted by Adam above (I tried Adam's LISP program, it's just brilliant well), I shouldn't have trouble struggling with LISP.   Thank you!

Message 10 of 12
s_abeed
in reply to: Jimcao07

Hi 

 

You able to find some solution or using lisp command. I am searching for the solution as well and so far I have the lisp solution as well and not something in .NET

 

 

Regards

Salman

Message 11 of 12
daniel_cadext
in reply to: s_abeed

maybe use MgdDbg, should have a DXF filer

https://github.com/ADN-DevTech/MgdDbg

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Message 12 of 12
s_abeed
in reply to: Anonymous

Thanks Daniel for sharing the ArxDbg .NET version and I am able to give it a try. I was not aware of this tool so good to know and I have this code that will be handy in future.

 

However it doesn't have the DXF option as available in the regular ARXDBG comes with SDK.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost