But if you get the shape out of the document:
Code: Select all
s = App.ActiveDocument.Box.Shape
s.edges[1] will be most likely "ActiveDocument.Box.Edge1".
Code: Select all
s = App.ActiveDocument.Box.Shape
Is there (yet) any other then 'the main' mechanism? Are there plans to introduce such?jriegel wrote:The main mechanism at the moment for the naming is the ordering in the brep structure.
Numbering in FreeCAD starts with One, whereas indices in pyhton start with zero.jriegel wrote:But if you get the shape out of the document:you are on python object level. Her we have no interface for naming. You can guess by usingCode: Select all
s = App.ActiveDocument.Box.Shape
s.edges[1] will be most likely "ActiveDocument.Box.Edge1".
Code: Select all
>>> App.ActiveDocument.Box.Shape.Edge1.isSame(App.ActiveDocument.Box.Shape.Edges[0])
True
Code: Select all
roundedw = wedge.makeFillet(20,wedge.Edges[1:8:2])
roundedlid = lid.makeFillet(30,lid.Edges[0:8:2])
roundedlidinner = lidinner.makeFillet(20,lidinner.Edges[0:8:2])
lid=roundedlid.cut(roundedlidinner)
lid2=lid.makeFillet(7,lid.Edges[0:1]+lid.Edges[12:19])
That's wrong! s.Edges[0] is the same as ActiveDocument.Box.Edge1. Note: In the python list we start with the element 0 while on document level we start with 1.you are on python object level. Her we have no interface for naming. You can guess by using
s.edges[1] will be most likely "ActiveDocument.Box.Edge1".
The TopoShape class in Python has the method replaceShape(). The argument is a list of tuples. You can use it this way:It seems that I'll only be able to create geometry but not modify it.
Code: Select all
myShape.replaceShape([(subShape1OfmyShape, newShape1), (subShape2OfmyShape, newShape2)])
Warner,It seems that I'll only be able to create geometry but not modify it.
Code: Select all
5. Conclusions
Persistent naming and naming mapping problems
occur during the exchange of CAD models that have
parametric information. The present study analyzes the
characteristics of the persistent naming problem from
the viewpoint of exchanging CAD models. Based on the
analysis of related works, a persistent naming method
and a naming mapping method are proposed. The
proposed persistent naming method is based on OSI
(object space information) and SN (secondary name).
OSI is used to solve the ambiguity problem that arises
from entity splitting. SN is used to solve the ambiguity
problem that arises from entity merging. The proposed
naming mapping method uses IGM. TGM is a geometric
model generated by a geometric modeling kernel
according to the design history. The design history is in
the form of a feature tree or a macro file, and the
necessary information for naming mapping is retrieved
or calculated from the IGM.
The persistent naming method and naming mapping
method proposed in the present study have been
adopted into a macro parametric translator [17, 18].
Parametric information has been successfully transferred
in an experimental implementation.