Recommended Posts

Posted (edited)

Mam taki problem. Skompilował dll-kę z tego kodu https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-01A47A4F-9FC5-4DB6-8C3E-B72D75688965-htm.html

Po załadowaniu komendą addhatch Zwcad tworzy okrąg ale pusty. VERNUM = "2018.07.26(35476)_x64". Gdy rozciągnę okrąg wypełnia się hatch-em. Gdy zaznaczę hatch i sprawdzę jego właściwości, pod hasłem geometria jest tylko właściwość wzniesienie - brak właściwości pole. Kopiuje sam okrąg i hatch robię pod Zwcad. Tutaj we właściwościach hatcha mamy podane pole.

Jak usprawnić kod, aby:

- kreskowanie wyświetlało się od razu, a nie po zmianie geometrii okręgu

- możliwy był odczyt pola kreskowania

W kodzie użyłem kreskowania solid.

 

Edited by Parikon
Posted

Wygląda na to, że hund begraben jest w kodzie DXF 92. Po wstawieniu hatcha  z .NET API  kod wynosi 0. Sprawdziłem że dla kodu 1 jest liczona powierzchnia. Dla innych nie sprawdzałem.

Wyciąg z dokumentacji kodów DXF

Boundary Path Data
The boundary of each hatch object is defined by a path (or loop) that consists
of one or more segments. Path segment data varies depending on the entity
type (or types) that make up the path. Each path segment is defined by its
own set of group codes. For information about abbreviations and formatting
used in this table, see Formatting Conventions in This Reference on page 2.
Hatch boundary path data group codes
Description Group code
Boundary path type flag (bit coded): 92
0 = Default; 1 = External; 2 = Polyline
4 = Derived; 8 = Textbox; 16 = Outermost

Lekarstwo w lisp'ie.

(defun c:hatchfix ( / entity dxfdata old-dxf new-dxf dxfdata )
(setq entity    (car (entsel))
     dxfdata   (entget entity)
     old-dxf  (assoc 92 dxfdata)
     new-dxf '(92 . 1)
     dxfdata   (subst new-dxf old-dxf dxfdata)
)
(entmod dxfdata)
)

W C# jeszcze nie znalazłem co i jak trzeba zafiksować żeby DXF 92 był 1. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...