NaxToPy 1.5.6__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {NaxToPy-1.5.6 → naxtopy-2.0.0}/LICENSE +1 -1
  2. {NaxToPy-1.5.6/src/NaxToPy.egg-info → naxtopy-2.0.0}/PKG-INFO +10 -4
  3. {NaxToPy-1.5.6 → naxtopy-2.0.0}/README.md +8 -2
  4. {NaxToPy-1.5.6 → naxtopy-2.0.0}/pyproject.toml +1 -1
  5. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PComponent.py +9 -9
  6. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PElement.py +1 -1
  7. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PFreeBody.py +2 -2
  8. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PIncrement.py +19 -31
  9. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PLoadCase.py +5 -9
  10. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PModelInputData.py +29 -3
  11. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PNode.py +1 -1
  12. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PReport.py +1 -1
  13. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PResult.py +28 -4
  14. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Constants/Constants.py +8 -7
  15. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Errors/N2PLog.py +51 -19
  16. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/N2PModelContent.py +41 -34
  17. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Reference_Finder/__Reference_Finder.py +57 -15
  18. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Modules/Fasteners/N2PUpdateFastener.py +34 -9
  19. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Modules/N2PEnvelope/N2PEnvelope.py +3 -3
  20. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Modules/N2PtoEXE/N2PtoEXE.py +2 -1
  21. {NaxToPy-1.5.6 → naxtopy-2.0.0/src/NaxToPy.egg-info}/PKG-INFO +10 -4
  22. {NaxToPy-1.5.6 → naxtopy-2.0.0}/setup.cfg +0 -0
  23. {NaxToPy-1.5.6 → naxtopy-2.0.0}/setup.py +0 -0
  24. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/AllClasses.py +0 -0
  25. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PConnector.py +0 -0
  26. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PCoord.py +0 -0
  27. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PMaterial.py +0 -0
  28. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PProperty.py +0 -0
  29. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PSection.py +0 -0
  30. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/N2PSet.py +0 -0
  31. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/ProgresBar.py +0 -0
  32. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Classes/__init__.py +0 -0
  33. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Constants/__init__.py +0 -0
  34. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Constants/librerias.py +0 -0
  35. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Errors/N2PColors.py +0 -0
  36. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Errors/N2PFileHandler.py +0 -0
  37. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Errors/__init__.py +0 -0
  38. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/Reference_Finder/__init__.py +0 -0
  39. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/_AuxFunc/_NetToPython.py +0 -0
  40. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/_AuxFunc/__init__.py +0 -0
  41. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Core/__init__.py +0 -0
  42. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Modules/Fasteners/__init__.py +0 -0
  43. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Modules/N2PEnvelope/__init__.py +0 -0
  44. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Modules/N2PtoEXE/__init__.py +0 -0
  45. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/Modules/__init__.py +0 -0
  46. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/NaxToPy.ico +0 -0
  47. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/__init__.py +0 -0
  48. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy/user_functions.txt +0 -0
  49. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy.egg-info/SOURCES.txt +0 -0
  50. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy.egg-info/dependency_links.txt +0 -0
  51. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy.egg-info/requires.txt +0 -0
  52. {NaxToPy-1.5.6 → naxtopy-2.0.0}/src/NaxToPy.egg-info/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- Copyright (c) 2023 Idaero Solutions
1
+ Copyright (c) 2024 Idaero Solutions
2
2
 
3
3
  This freeware license agreement (“agreement”) is a legally binding contract
4
4
  between the individual who downloads the software (“you”) and the licensor,
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: NaxToPy
3
- Version: 1.5.6
3
+ Version: 2.0.0
4
4
  Summary: Package for postprocessing FEM results in Python
5
5
  Home-page: https://www.idaerosolutions.com/Home/NaxToPy
6
6
  Download-URL: https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US
7
7
  Author-email: Idaero Solutions <manuel.sanchez@idaerosolutions.com>
8
- License: Copyright (c) 2023 Idaero Solutions
8
+ License: Copyright (c) 2024 Idaero Solutions
9
9
 
10
10
  This freeware license agreement (“agreement”) is a legally binding contract
11
11
  between the individual who downloads the software (“you”) and the licensor,
@@ -146,8 +146,9 @@ links on the left).
146
146
 
147
147
  **NaxToPy** is a powerful tool for FEM analysis post-processing!
148
148
 
149
- **CAUTION:** This version is only compatible with **NaxTo 2024.0.5**.
150
- Check in _Programs and Features_ the NaxTo version that is installed.
149
+ **CAUTION:** To use NaxToPy, [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US) must be installed.
150
+ This version is compatible with **NaxTo 2024.1**. It may be compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).
151
+ Check in _Programs and Features_ the NaxTo version that is installed.
151
152
 
152
153
  ## Installation
153
154
 
@@ -254,6 +255,11 @@ To see previous version see the pre-release versions in https://test.pypi.org/pr
254
255
  1. The method new_envelope_loadcase() now has the option to choose the envelope group. Which means the user can ask for
255
256
  the LoadCases that are critical or the Increment that is critical instead of the value.
256
257
 
258
+ ### v.2.0.0
259
+ 1. Changes made to align the library with updates in lower-level dependencies.
260
+ 2. New internal methods to look for the compatibility with low-level dependencies.
261
+ 3. The name of the .log is now NaxToPy_Year-Month-Day.log.
262
+
257
263
  # Documentation
258
264
 
259
265
  **NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
@@ -22,8 +22,9 @@ links on the left).
22
22
 
23
23
  **NaxToPy** is a powerful tool for FEM analysis post-processing!
24
24
 
25
- **CAUTION:** This version is only compatible with **NaxTo 2024.0.5**.
26
- Check in _Programs and Features_ the NaxTo version that is installed.
25
+ **CAUTION:** To use NaxToPy, [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US) must be installed.
26
+ This version is compatible with **NaxTo 2024.1**. It may be compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).
27
+ Check in _Programs and Features_ the NaxTo version that is installed.
27
28
 
28
29
  ## Installation
29
30
 
@@ -130,6 +131,11 @@ To see previous version see the pre-release versions in https://test.pypi.org/pr
130
131
  1. The method new_envelope_loadcase() now has the option to choose the envelope group. Which means the user can ask for
131
132
  the LoadCases that are critical or the Increment that is critical instead of the value.
132
133
 
134
+ ### v.2.0.0
135
+ 1. Changes made to align the library with updates in lower-level dependencies.
136
+ 2. New internal methods to look for the compatibility with low-level dependencies.
137
+ 3. The name of the .log is now NaxToPy_Year-Month-Day.log.
138
+
133
139
  # Documentation
134
140
 
135
141
  **NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "NaxToPy"
7
- version = "1.5.6"
7
+ version = "2.0.0"
8
8
  license = {file = "LICENSE"}
9
9
  authors = [ { name = "Idaero Solutions", email = "manuel.sanchez@idaerosolutions.com" }, ]
10
10
  requires-python = ">=3.9"
@@ -1,7 +1,7 @@
1
1
  from NaxToPy.Core.Classes.N2PSection import N2PSection
2
2
  from NaxToPy.Core.Errors.N2PLog import N2PLog
3
- from VizzerClasses import N2ParamInputResults
4
- from VizzerClasses import N2TensorTransformation
3
+ from NaxToModel import N2ParamInputResults
4
+ from NaxToModel import N2TensorTransformation
5
5
  from array import array
6
6
  import numpy as np
7
7
  from NaxToPy.Core._AuxFunc._NetToPython import _numpytonet
@@ -31,7 +31,7 @@ class N2PComponent:
31
31
  """
32
32
  self.__name__ = name
33
33
  self.__sections__ = [N2PSection(sections[i].Name,
34
- sections[i].number) for i in range(0, len(sections))]
34
+ sections[i].Number) for i in range(0, len(sections))]
35
35
  self.__result_father__ = result_father
36
36
  # ---------------------------------------------------------------------------------------------
37
37
 
@@ -62,7 +62,7 @@ class N2PComponent:
62
62
  component = self.Name
63
63
  return bool(N2TensorTransformation.IsResultSupported(solver, result, component))
64
64
 
65
- # Metodo para llamar a la funcion de VizzerClasses que devueleve el array de resultados-----------------------------
65
+ # Metodo para llamar a la funcion de NaxToModel que devueleve el array de resultados-----------------------------
66
66
  def get_result_array(self, sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100,
67
67
  realPolar=0, coordsys: int = -1000,
68
68
  v1: tuple = (1, 0, 0), v2: tuple = (0, 1, 0)) -> tuple[list, str]:
@@ -72,7 +72,7 @@ class N2PComponent:
72
72
  realPolar, coordsys, v1, v2)
73
73
  # ------------------------------------------------------------------------------------------------------------------
74
74
 
75
- # Metodo para llamar a la funcion de VizzerClasses que devueleve el array de resultados como lista------------------
75
+ # Metodo para llamar a la funcion de NaxToModel que devueleve el array de resultados como lista------------------
76
76
  def get_result_list(self, sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100,
77
77
  realPolar=0, coordsys: int = -1000,
78
78
  v1: Union[tuple, np.ndarray] = (1,0,0), v2: Union[tuple, np.ndarray] = (0,1,0)) -> tuple[list, str]:
@@ -136,7 +136,7 @@ class N2PComponent:
136
136
  results: tuple(list[float], str)
137
137
 
138
138
  """
139
- # Aquí se prepara la llamada a la funcion de VizzerClasses.N2PModelContent.getArraytoPlot(). Esta usa como
139
+ # Aquí se prepara la llamada a la funcion de NaxToModel.N2PModelContent.getArraytoPlot(). Esta usa como
140
140
  # argumento un objeto de la clase N2ParamImputResults. Por se instancia y se modifican sus propiedades antes
141
141
  # de hacer la llamada a la funcion.
142
142
 
@@ -164,7 +164,7 @@ class N2PComponent:
164
164
  return(-1, 'NO RESULTS')
165
165
  # ------------------------------------------------------------------------------------------------------------------
166
166
 
167
- # Metodo para llamar a la funcion de VizzerClasses que devuelve el array de resultados como array de numpy----------
167
+ # Metodo para llamar a la funcion de NaxToModel que devuelve el array de resultados como array de numpy----------
168
168
  def get_result_ndarray(self, sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100,
169
169
  realPolar=0, coordsys: int = -1000,
170
170
  v1: Union[tuple, np.ndarray ] = (1,0,0), v2: Union[tuple, np.ndarray ] = (0,1,0)) -> tuple[np.array, str]:
@@ -245,7 +245,7 @@ class N2PComponent:
245
245
  return(-1, 'NO RESULTS')
246
246
  # ------------------------------------------------------------------------------------------------------------------
247
247
 
248
- # # Metodo que devulve un dataframe con los resulados tras llamar a la funcion de VizzerClasses--
248
+ # # Metodo que devulve un dataframe con los resulados tras llamar a la funcion de NaxToModel--
249
249
  # def get_result_dataframe(self, sections=None, aveSections=-1, cornerData=False, aveNodes=-1,
250
250
  # variation=100, realPolar=0, coordsys: int = -1000,
251
251
  # v1: tuple = (1,0,0), v2: tuple = (0,1,0)) -> DataFrame:
@@ -392,7 +392,7 @@ class N2PComponent:
392
392
  return py_dict
393
393
  # ------------------------------------------------------------------------------------------------------------------
394
394
 
395
- # Metodo que crea la formula que necesita la funcion de VizzerClasses ----------------------------------------------
395
+ # Metodo que crea la formula que necesita la funcion de NaxToModel ----------------------------------------------
396
396
  def _create_formula(self, list_lc_incr: list[tuple["N2PLoadCase", "N2PIncrement"],...]) -> str:
397
397
 
398
398
  if isinstance(list_lc_incr, tuple):
@@ -1,7 +1,7 @@
1
1
  import array
2
2
 
3
3
  from NaxToPy.Core.Classes.N2PNode import N2PNode
4
- from VizzerClasses import N2ElementsCoordinateSystems
4
+ from NaxToModel import N2ElementsCoordinateSystems
5
5
 
6
6
  # Clase Element de Python
7
7
  class N2PElement:
@@ -1,6 +1,6 @@
1
1
  """ Module with all the FreeBody related classes.
2
2
  """
3
- from VizzerClasses import N2FBDSection, N2FBD, N2FBDResult
3
+ from NaxToModel import N2FBDSection, N2FBD, N2FBDResult
4
4
  from NaxToPy.Core.Classes.N2PNode import N2PNode
5
5
  from NaxToPy.Core.Classes.N2PElement import N2PElement
6
6
  from NaxToPy.Core.Classes.N2PCoord import N2PCoord
@@ -61,7 +61,7 @@ class N2PFreeBody(object):
61
61
  else:
62
62
  self.__centroid = True
63
63
 
64
- # Llamada al constructor de VizzerClasses
64
+ # Llamada al constructor de NaxToModel
65
65
  n2fbdsection = N2FBDSection(self.__name)
66
66
 
67
67
  # Se incluye la parte:
@@ -1,64 +1,52 @@
1
1
  # Clase Increment de Python --------------------------------------------------------------------------------------------
2
2
  class N2PIncrement:
3
- '''Class which contains the information associated to an increment/frame of a N2PLoadCase instance.
4
-
5
- Attributes:
6
- Name: str.
7
- ImaginaryEigenvalue: float.
8
- RealEigenvalue: float.
9
- ID: int.
10
- Time: double.
11
- '''
3
+ """Class which contains the information associated to an increment/frame of a N2PLoadCase instance."""
12
4
 
13
5
  # Constructor de N2PIncrement --------------------------------------------------------------------------------------
14
- def __init__(self, name, eigi, eigr, number, time):
15
- '''Python Increment Constructor
16
- Input:
17
- name: str -> name of the increment
18
- eigi: double -> value of the imaginary eigenvalue
19
- eigr: double -> value of the real eigenvalue
20
- number: int -> number of the increment within the sequence of increments in the load case
21
- time: double -> value of the increment
22
- ----------
23
- Returns:
24
- N2PIncrement: object
25
- '''
26
- self.__name__ = name
27
- self.__eigi__ = eigi
28
- self.__eigr__ = eigr
29
- self.__number__ = number
30
- self.__time__ = time
6
+ def __init__(self, info):
7
+ self.__info__ = info
31
8
  # ------------------------------------------------------------------------------------------------------------------
32
9
 
33
10
  # Metodo para obtener el nombre del incremento ---------------------------------------------------------------------
34
11
  @property
35
12
  def Name(self) -> str:
36
- return(str(self.__name__))
13
+ """Name of the Increment"""
14
+ return(str(self.__info__.Name))
37
15
  # ------------------------------------------------------------------------------------------------------------------
38
16
 
39
17
  # Metodo para obtener el valor del autovalor real ------------------------------------------------------------------
40
18
  @property
41
19
  def RealEigenvalue(self) -> float:
42
- return(float(self.__eigr__))
20
+ """Real Eigenvalue of the increment"""
21
+ return(float(self.__info__.EigReal))
43
22
  # ------------------------------------------------------------------------------------------------------------------
44
23
 
45
24
  # Metodo para obtener el valor del autovalor imaginario ------------------------------------------------------------
46
25
  @property
47
26
  def ImaginaryEigenvalue(self) -> float:
48
- return(float(self.__eigi__))
27
+ """Imaginary Eigenvalue of the increment"""
28
+ return(float(self.__info__.EigImg))
49
29
  # ------------------------------------------------------------------------------------------------------------------
50
30
 
51
31
  # Metodo para obtener el ID del incremento en el caso de carga -----------------------------------------------------
52
32
  @property
53
33
  def ID(self) -> int:
54
- return(int(self.__number__))
34
+ """Solver ID of the Increment"""
35
+ return(int(self.__info__.ID))
55
36
  # ------------------------------------------------------------------------------------------------------------------
56
37
 
57
38
  # Metodo para obtener el valor del incremento ----------------------------------------------------------------------
58
39
  @property
59
40
  def Time(self) -> float:
60
41
  ''' Returns the value of the increment/frame'''
61
- return(float(self.__time__))
42
+ return(float(self.__info__.Time))
43
+ # ------------------------------------------------------------------------------------------------------------------
44
+
45
+ # Metodo para obtener el tipo de Solucion --- ----------------------------------------------------------------------
46
+ @property
47
+ def Solution(self) -> str:
48
+ """Returns the value of the Solution name of the Increment"""
49
+ return(str(self.__info__.Solution))
62
50
  # ------------------------------------------------------------------------------------------------------------------
63
51
 
64
52
  # Special Method for Object Representation -------------------------------------------------------------------------
@@ -46,27 +46,23 @@ class N2PLoadCase:
46
46
  self.__id__ = id
47
47
  self.__idoriginal__ = id_original
48
48
 
49
- self.__increments__ = [N2PIncrement(increments[i].Name,
50
- increments[i].eigi,
51
- increments[i].eigr,
52
- increments[i].number,
53
- increments[i].time) for i in range(0, len(increments))]
49
+ self.__increments__ = [N2PIncrement(increments[i]) for i in range(0, len(increments))]
54
50
 
55
51
  self.__incrementsnumberlist__ = increments_number_list
56
52
  self.__iscomplex__ = is_complex
57
53
  self.__lctype__ = lc_type
58
54
  self.__namelc__ = name
59
- self.__results__ = {results[i].name: N2PResult(results[i].Components,
55
+ self.__results__ = {results[i].Name: N2PResult(results[i].Components,
60
56
  results[i].Position,
61
57
  results[i].derivedComps,
62
- results[i].description,
58
+ results[i].Description,
63
59
  results[i].elemTypes,
64
60
  results[i].fcode,
65
- results[i].name,
61
+ results[i].Name,
66
62
  self) for i in range(0, len(results))}
67
63
 
68
64
  self.__solutiontype__ = solution_type
69
- self.__activeIncrement__ = list(increments)[-1].number
65
+ self.__activeIncrement__ = list(increments)[-1].ID
70
66
  self.__solver__ = solver
71
67
  self.__modelFather__ = model_father
72
68
  self.__n2loadcase = n2loadcase
@@ -47,9 +47,9 @@ class N2PInputData:
47
47
  def Lines(self) -> list[str, ...]:
48
48
  return list(self.__inputdata.Lines)
49
49
 
50
- # @property
51
- # def FilePathId(self) -> str:
52
- # return self.__inputdata.FilePathId
50
+ @property
51
+ def FilePathId(self) -> int:
52
+ return self.__inputdata.FilePathId
53
53
 
54
54
  # @property
55
55
  # def Children(self) -> list["N2PInputData"]:
@@ -127,6 +127,9 @@ class N2PModelInputData:
127
127
  def __init__(self, listbulkdatacards, inputfiledata):
128
128
  self.__listbulkdatacards = listbulkdatacards
129
129
  self.__inputfiledata = inputfiledata
130
+ self.__listinstructions = []
131
+ self.__listcomments = []
132
+ self.__dictionary_files_ids = {value: key for key, value in self.DictionaryIDsFiles.items()}
130
133
 
131
134
  @property
132
135
  def ListBulkDataCards(self) -> list[N2PCard, ...]:
@@ -137,10 +140,33 @@ class N2PModelInputData:
137
140
  def DictionaryIDsFiles(self) -> dict:
138
141
  return dict(self.__inputfiledata.DictionaryIDsFiles)
139
142
 
143
+ @property
144
+ def DictionaryFilesIDs(self) -> dict:
145
+ return dict(self.__dictionary_files_ids)
146
+
140
147
  @property
141
148
  def TypeOfFile(self) -> str:
142
149
  return self.__inputfiledata.TypeOfFile.ToString()
143
150
 
151
+ @property
152
+ def ListInstructions(self) -> list[N2PInputData]:
153
+ """List with the instructions of the model. They are the commands above the BEGIN BULK: Executive Control
154
+ Statements and Control Case Commands"""
155
+ if self.__listinstructions:
156
+ return self.__listinstructions
157
+ else:
158
+ self.__listinstructions = [N2PInputData(i) for i in self.__inputfiledata.StructuredInfo.ModelInstructions]
159
+ return self.__listinstructions
160
+
161
+ @property
162
+ def ListComments(self) -> list[N2PInputData]:
163
+ """List with all the comments in the FEM Input File"""
164
+ if self.__listcomments:
165
+ return self.__listcomments
166
+ else:
167
+ self.__listcomments = [N2PInputData(i) for i in self.__inputfiledata.StructuredInfo.ModelComments]
168
+ return self.__listcomments
169
+
144
170
  def get_cards_by_field(self, fields: list[str, ], row: int = 0, col: int = 0) -> list[N2PCard, ]:
145
171
  """Method that returns a list with the N2PCard objects of the input FEM file that meet the condition.
146
172
  In other words, that field is equal to the string in the position defined. If no row or column is defined, the
@@ -1,6 +1,6 @@
1
1
  import array
2
2
  import time
3
- from VizzerClasses.Classes import N2AdjacencyFunctions
3
+ from NaxToModel.Classes import N2AdjacencyFunctions
4
4
 
5
5
 
6
6
  class N2PNode:
@@ -7,7 +7,7 @@ from NaxToPy.Core.Classes.N2PComponent import _get_axis
7
7
  from NaxToPy.Core._AuxFunc._NetToPython import _numpytonet
8
8
  import numpy as np
9
9
  from typing import Union
10
- from VizzerClasses import N2Report, N2ParamInputResults, N2Enums
10
+ from NaxToModel import N2Report, N2ParamInputResults, N2Enums
11
11
  from System import Object, Array
12
12
 
13
13
 
@@ -1,6 +1,6 @@
1
1
  from NaxToPy.Core.Classes.N2PComponent import N2PComponent
2
2
  from NaxToPy.Core.Errors.N2PLog import N2PLog
3
- from VizzerClasses import N2Component
3
+ from NaxToModel import N2Component
4
4
  from System.Collections.Generic import List
5
5
 
6
6
 
@@ -84,7 +84,31 @@ class N2PResult:
84
84
 
85
85
  # Metodo para obtener las componentes disponibles en el resultado -----------------------------
86
86
  def get_component(self, name: str) -> N2PComponent:
87
- """Returns a N2Component as component with name specified
87
+ """Returns a N2Component as component with name specified. It can be a Raw Component or a derived component
88
+
89
+ Args:
90
+ name: str
91
+
92
+ Returns:
93
+ component: N2PComponent
94
+ """
95
+
96
+ if isinstance(name, str):
97
+ component = self.Components.get(name, None)
98
+ if not component:
99
+ component = self.DerivedComponents.get(name, None)
100
+ if component is None:
101
+ N2PLog.Error.E215(name)
102
+ return component
103
+
104
+ # Devolver todos los resultados
105
+ else:
106
+ N2PLog.Error.E216()
107
+ # ---------------------------------------------------------------------------------------------
108
+
109
+ # Metodo para obtener las componentes originales disponibles en el resultado -----------------------------
110
+ def get_raw_component(self, name: str) -> N2PComponent:
111
+ """Returns a N2Component as component with name specified. It checks only in the original list of components
88
112
 
89
113
  Args:
90
114
  name: str
@@ -154,10 +178,10 @@ class N2PResult:
154
178
  # Recuperamos la instancia N2ModelModelContent
155
179
  mc = self.__loadCase_father__.__modelFather__._N2PModelContent__vzmodel
156
180
 
157
- # Llamada al constructor de N2Component de VizzerClasses
181
+ # Llamada al constructor de N2Component de NaxToModel
158
182
  new_d_comp = N2Component(mc, name, formula)
159
183
 
160
- # Se incluye en la lista de compornentes derivadas de vizzerclasses. Para ello tengo que comprobar que existe
184
+ # Se incluye en la lista de compornentes derivadas de NaxToModel. Para ello tengo que comprobar que existe
161
185
  # dicha lista. Si no existe la tengo que crear como lista de C#
162
186
  if not mc.DerivedComponents:
163
187
  mc.DerivedComponents = List[N2Component]()
@@ -1,14 +1,15 @@
1
1
  """Constants of the NaxToPy package"""
2
2
 
3
3
  # NaxToPy Version
4
- VERSION = "1.5.6"
4
+ VERSION = "2.0.0"
5
5
 
6
6
  # Supported for Naxto:
7
- NAXTO_VERSION = '2024R0'
8
- NAXTO_STEP = "5"
7
+ NAXTO_VERSION = '2024R1'
8
+ NAXTO_STEP = "0"
9
9
 
10
- # Assembly version of VizzerClasses.dll
11
- VIZZER_ASSEMBLY = "4.0.0.5"
10
+ # Assembly version of NaxToModel.dll
11
+ VIZZER_COMPATIBILITY = ("4.1.0.0", "4.1.0.1")
12
+ """Tuple with the compatible versions of NaxToModel.dll"""
12
13
 
13
14
  # PYTHON EXTERNO ----------------------------------------------------------------------------------
14
15
  # Versiones de Python soportadas:
@@ -28,10 +29,10 @@ BINARY_EXTENSIONS = ["op2", "xdb", "h5", "h3d", "odb", "rst"]
28
29
 
29
30
  # NAXTO -------------------------------------------------------------------------------------------
30
31
  # Ruta a las librerias de NaxTo
31
- DEVELOPER_VIZZER = r'C:\GIT_REPOSITORIES\NAXTO\NAXTOVIEW\v.3.0\NAX2VIZZER\VizzerClasses\bin\x64\Debug'
32
+ DEVELOPER_VIZZER = r'C:\GIT_REPOSITORIES\NAXTO\NAXTOVIEW\v.4.0\NaxToView\NaxToModel\bin\x64\Debug'
32
33
 
33
34
  # DLLs de NaxTo
34
- VIZZER_CLASSES_DLL = 'VizzerClasses.dll'
35
+ VIZZER_CLASSES_DLL = 'NaxToModel.dll'
35
36
  # -------------------------------------------------------------------------------------------------
36
37
 
37
38
  PEDIGREE_FACTOR = 1000 # Para pasar de id pedigree a id solver: id_solver = id_pedigree // _PEDIGREE_FACTOR_
@@ -52,7 +52,7 @@ class N2PLog(ABC):
52
52
  if __directory == "C:\\Users":
53
53
  __directory = os.path.expanduser("~") + "\\Documents\\"
54
54
 
55
- __filename = time.strftime("NaxToPy_%d-%m-%Y.log", time.localtime())
55
+ __filename = time.strftime("NaxToPy_%Y-%m-%d.log", time.localtime())
56
56
  __path = os.path.join(__directory, __filename)
57
57
 
58
58
  __logger = logging.getLogger('Logger')
@@ -136,8 +136,8 @@ class N2PLog(ABC):
136
136
 
137
137
  @staticmethod
138
138
  def D101(path) -> None:
139
- """Method that shows the location of the VizzerClasses library found"""
140
- message = f"VizzerClasses found at: {path}"
139
+ """Method that shows the location of the NaxToModel library found"""
140
+ message = f"NaxToModel found at: {path}"
141
141
  N2PLog._N2PLog__logger.debug(message)
142
142
 
143
143
  @staticmethod
@@ -207,18 +207,23 @@ own information message. Use the following structure as a standard message (I +
207
207
  def I100() -> None:
208
208
  """ Information that show that the NaxToPy Runing Code.
209
209
  """
210
- from IdaeroLicense import LicenseManager
210
+ from NaxToLicense import LicenseManager
211
211
  from System import DateTime
212
+ from datetime import datetime
213
+
214
+ current_date = datetime.now()
215
+
216
+ time_date = DateTime(current_date.year, current_date.month, current_date.day, current_date.hour,
217
+ current_date.minute, current_date.second)
212
218
 
213
- time_date = DateTime.Now
214
219
  licen = LicenseManager()
215
220
 
216
- if licen.HasLicense():
221
+ if not licen.HasLicense():
217
222
  err = LicenseManager.GenerateCommunityLicense()
218
223
  licen.HasLicense()
219
224
 
220
225
  code = licen.GetRunCode(time_date)
221
- message = f"I100: The NaxToPy Running with the code: {code}"
226
+ message = f"I100: NaxToPy Running with the code: {code}"
222
227
  N2PLog._set_format2(time_date.ToString().split(" ")[1])
223
228
  N2PLog._N2PLog__logger.info(message)
224
229
  N2PLog._set_format1()
@@ -268,16 +273,16 @@ own information message. Use the following structure as a standard message (I +
268
273
 
269
274
  @staticmethod
270
275
  def I108() -> None:
271
- """ Information given when the program use the develover version of VizzerClasses.
276
+ """ Information given when the program use the develover version of NaxToModel.
272
277
  """
273
- message = "I108: Working with developer version of VizzerClasses."
278
+ message = "I108: Working with developer version of NaxToModel."
274
279
  N2PLog._N2PLog__logger.info(message)
275
280
 
276
281
  @staticmethod
277
282
  def I109() -> None:
278
- """ Information given when the VizzerClasses library is load correctly.
283
+ """ Information given when the NaxToModel library is load correctly.
279
284
  """
280
- message = f"I109: The library VizzerClasses.dll was load successfully."
285
+ message = f"I109: The library NaxToModel.dll was load successfully."
281
286
  N2PLog._N2PLog__logger.info(message)
282
287
 
283
288
  @staticmethod
@@ -378,6 +383,22 @@ own information message. Use the following structure as a standard message (I +
378
383
  message = f"W103: The Path Value in Windows Register has been deleted."
379
384
  N2PLog._N2PLog__logger.warning(message)
380
385
 
386
+ @staticmethod
387
+ def W104(naxver) -> None:
388
+ """ Warning raised when the version NaxTo that this NaxToPy version is prepared for is not found
389
+ """
390
+ message = f"W104: This NaxToPy should work with {naxver}, that is NOT found. Checking compatibility with" \
391
+ f"other versions installed"
392
+ N2PLog._N2PLog__logger.warning(message)
393
+
394
+ @staticmethod
395
+ def W105() -> None:
396
+ """ Warning raised when the assemblies founded are not saved as compatible
397
+ """
398
+ message = f"W105: No library was found to be compatible with this NaxToPy version. The package may" \
399
+ f"work but is recommended to find a compatible NaxTo or NaxToPy version."
400
+ N2PLog._N2PLog__logger.warning(message)
401
+
381
402
  @staticmethod
382
403
  def W200() -> None:
383
404
  """ Warning raised when the executable file is build without the icon
@@ -835,10 +856,11 @@ own information message. Use the following structure as a standard message (I +
835
856
  N2PLog._N2PLog__logger.error(message)
836
857
 
837
858
  @staticmethod
838
- def E312() -> None:
839
- ''' Error raised when the components asked for the N2PReport are not found in the model
859
+ def E312(lc, result) -> None:
860
+ ''' Error raised when the components asked for the N2PReport are not found in the result of the loadcase
840
861
  '''
841
- message = f"E312: THE COMPONENTS ASKED FOR THE N2PREPORT ARE NOT IN THE MODEL"
862
+ message = f"E312: THE COMPONENTS ASKED FOR THE N2PREPORT ARE NOT IN THE RESULT {result} OF THE " \
863
+ f"LOAD CASE {lc}"
842
864
  N2PLog._N2PLog__logger.error(message)
843
865
 
844
866
  @staticmethod
@@ -923,7 +945,7 @@ own information message. Use the following structure as a standard message (I +
923
945
  def C103() -> None:
924
946
  """ Critical Error raised when VizzerClasses.dll is not properly load.
925
947
  """
926
- message = f"C103: THE LIBRARY 'VizzerClasses.dll' COULDN'T BE LOADED CORRECTLY"
948
+ message = f"C103: THE LIBRARY 'NaxToModel.dll' COULDN'T BE LOADED CORRECTLY"
927
949
  N2PLog._N2PLog__logger.critical(message)
928
950
 
929
951
  @staticmethod
@@ -963,16 +985,18 @@ own information message. Use the following structure as a standard message (I +
963
985
 
964
986
  @staticmethod
965
987
  def C109(ver, comp_ver) -> None:
966
- """ Error raised when NaxTo is not installed.
988
+ """ Error raised when NaxTo is not compatible with NaxToPy.
967
989
  """
968
- message = f"C109: THIS VERSION OF NAXTOPY ({ver}) IS ONLY COMPATIBLE WITH THIS ASSEMBLY VERSION: {comp_ver}"
990
+ message = f"C109: THIS VERSION OF NAXTOPY ({ver}) IS NOT COMPATIBLE WITH THIS ASSEMBLY VERSION: {comp_ver}"
969
991
  N2PLog._N2PLog__logger.critical(message)
970
992
 
971
993
  @staticmethod
972
- def C110(ver, comp_ver) -> None:
994
+ def C110(ver, naxver) -> None:
973
995
  """ Error raised when there aren't installed a compatible version of with minor changes.
974
996
  """
975
- message = f"C110: THIS VERSION OF NAXTOPY({ver}) IS NOT COMPATIBLE WITH THIS NAXTO VERSION: {comp_ver}"
997
+ message = f"C110: THIS VERSION OF NAXTOPY({ver}) IS NOT COMPATIBLE WITH THE NAXTO VERSIONS THAT ARE " \
998
+ f"INSTALLED. UPDATE TO A COMPATIBLE NAXTO VERSION ({naxver}) OR DOWNLOAD FROM " \
999
+ f"https://pypi.org/project/NaxToPy/ A COMPATIBLE NAXTOPY VERSION"
976
1000
  N2PLog._N2PLog__logger.critical(message)
977
1001
 
978
1002
  @staticmethod
@@ -993,6 +1017,14 @@ own information message. Use the following structure as a standard message (I +
993
1017
  f"model = NaxToPy.load_model(path, parallelprocessing=True)"
994
1018
  N2PLog._N2PLog__logger.critical(message)
995
1019
 
1020
+ @staticmethod
1021
+ def C113(lib, ver, listver) -> None:
1022
+ """ Error raised when the NaxToPy versions the dll is compatible with is not this one
1023
+ """
1024
+ message = f"C113: THE LIBRARY {lib} IS NOT COMPATIBLE WITH NAXTOPY {ver}. INSTALL ANY OF THESE VERSION OF" \
1025
+ f"NAXTOPY {listver} OR UPDATE NAXTO"
1026
+ N2PLog._N2PLog__logger.critical(message)
1027
+
996
1028
  @staticmethod
997
1029
  def C200() -> None:
998
1030
  """ Critical error raised when numpy couldn't be installed.
@@ -1,9 +1,9 @@
1
- from VizzerClasses import N2ModelContent
2
- from VizzerClasses import N2LoadCase
3
- from VizzerClasses.Classes import N2AdjacencyFunctions
4
- from VizzerClasses.Classes import N2FreeEdges
5
- from VizzerClasses import EnvelopGroup
6
- from VizzerClasses import EnvelopCriteria
1
+ from NaxToModel import N2ModelContent
2
+ from NaxToModel import N2LoadCase
3
+ from NaxToModel.Classes import N2AdjacencyFunctions
4
+ from NaxToModel.Classes import N2FreeEdges
5
+ from NaxToModel import EnvelopGroup
6
+ from NaxToModel import EnvelopCriteria
7
7
  from NaxToPy.Core.Classes.N2PLoadCase import N2PLoadCase
8
8
  from NaxToPy.Core.Classes.N2PIncrement import N2PIncrement
9
9
  from NaxToPy.Core.Classes.N2PElement import N2PElement
@@ -19,6 +19,8 @@ from NaxToPy.Core.Classes.N2PSet import N2PSet
19
19
  from NaxToPy.Core.Classes.N2PModelInputData import *
20
20
  from NaxToPy.Core.Constants.Constants import BINARY_EXTENSIONS
21
21
  from NaxToPy.Core.Classes.N2PReport import N2PReport
22
+
23
+
22
24
  import time
23
25
  import sys
24
26
  import numpy as np
@@ -27,6 +29,7 @@ import array
27
29
  import System
28
30
  from collections import OrderedDict
29
31
  from typing import Union, overload
32
+ from itertools import chain
30
33
 
31
34
 
32
35
  # Clase Model Content de Python ----------------------------------------------------------------------------------------
@@ -269,15 +272,15 @@ class N2PModelContent:
269
272
  ######################################## N2PModelInputData ##############################################
270
273
  ################################################################################################################
271
274
  t1 = time.time()
272
- if self.__vzmodel.InfoInputFileData is not None:
273
- n2pmodelimpudata = self.__vzmodel.InfoInputFileData.ListBulkDataCards
275
+ if self.__vzmodel.NastranInfoInputFileData is not None:
276
+ n2pmodelimpudata = self.__vzmodel.NastranInfoInputFileData.ListBulkDataCards
274
277
 
275
278
  #lista_cards = zeros(len(n2pmodelimpudata), object)
276
279
  #diccionario
277
280
  #llamar por separado a las tarjetas (props, elems, mat, ...)
278
281
  #lista_cards = [construct_dict[card.CardType.ToString()](card) for card in n2pmodelimpudata]
279
282
  lista_cards = list(CONSTRUCTDICT[card.CardType.ToString()](card) for card in n2pmodelimpudata)
280
- self.__modelinputdata = N2PModelInputData(lista_cards, self.__vzmodel.InfoInputFileData)
283
+ self.__modelinputdata = N2PModelInputData(lista_cards, self.__vzmodel.NastranInfoInputFileData)
281
284
 
282
285
  else:
283
286
  self.__modelinputdata = None
@@ -385,11 +388,11 @@ class N2PModelContent:
385
388
  if self.Solver == "Nastran" or self.Solver == "Optistruct" or self.Solver == "InputFileNastran":
386
389
  key = int(key)
387
390
 
388
- if value.GetType().ToString() == 'VizzerClasses.N2MatE':
391
+ if value.GetType().ToString() == 'NaxToModel.N2MatE':
389
392
  self.__material_dict[key] = N2PMatE(value, self)
390
- elif value.GetType().ToString() == 'VizzerClasses.N2MatI':
393
+ elif value.GetType().ToString() == 'NaxToModel.N2MatI':
391
394
  self.__material_dict[key] = N2PMatI(value, self)
392
- elif value.GetType().ToString() == 'VizzerClasses.N2MatMisc':
395
+ elif value.GetType().ToString() == 'NaxToModel.N2MatMisc':
393
396
  self.__material_dict[key] = N2PMatMisc(value, self)
394
397
 
395
398
  t2 = time.time()
@@ -423,13 +426,13 @@ class N2PModelContent:
423
426
  if key < 0:
424
427
  N2PLog.Error.E227(key)
425
428
 
426
- if value.GetType().ToString() == 'VizzerClasses.N2Shell':
429
+ if value.GetType().ToString() == 'NaxToModel.N2Shell':
427
430
  self.__property_dict[key] = N2PShell(value, self)
428
431
 
429
- elif value.GetType().ToString() == 'VizzerClasses.N2Comp':
432
+ elif value.GetType().ToString() == 'NaxToModel.N2Comp':
430
433
  self.__property_dict[key] = N2PComp(value, self)
431
434
 
432
- elif value.GetType().ToString() == 'VizzerClasses.N2Solid':
435
+ elif value.GetType().ToString() == 'NaxToModel.N2Solid':
433
436
  self.__property_dict[key] = N2PSolid(value, self)
434
437
 
435
438
  t2 = time.time()
@@ -1092,13 +1095,13 @@ class N2PModelContent:
1092
1095
  # Argumentos para N2LoadCase
1093
1096
  envelopgroup = N2LoadCase
1094
1097
 
1095
- # Genera una instancia de un N2LoadCase the VizzerClasses
1098
+ # Genera una instancia de un N2LoadCase de NaxToModel
1096
1099
  cs_lc = N2LoadCase(self.__vzmodel, name, formula)
1097
1100
 
1098
1101
  # Método de N2LoadCase que pone todoo en su sitio
1099
1102
  cs_lc.RecalculateLCInfo2Formule()
1100
1103
 
1101
- # Se transforma el caso de carga de VizzerClasses en un N2PLoadCase de python
1104
+ # Se transforma el caso de carga de NaxToModel en un N2PLoadCase de python
1102
1105
  py_lc = N2PLoadCase(cs_lc.ID, cs_lc.IDOriginal, cs_lc.Increments, cs_lc.IncrementsNumberList, cs_lc.IsComplex,
1103
1106
  cs_lc.TypeLoadCase, cs_lc.Name, cs_lc.Results, cs_lc.SolutionType, cs_lc.Solver, self, cs_lc)
1104
1107
 
@@ -1114,7 +1117,8 @@ class N2PModelContent:
1114
1117
 
1115
1118
  return py_lc
1116
1119
 
1117
- def new_envelope_loadcase(self, name: str, formula: str, criteria: str="ExtremeMax") -> N2PLoadCase:
1120
+ def new_envelope_loadcase(self, name: str, formula: str, criteria: str = "ExtremeMax",
1121
+ envelgroup: str = "ByContour") -> N2PLoadCase:
1118
1122
  """Method of N2PModelContent that generate a new N2PLoadCase that is the envelope of the load cases and increments
1119
1123
  selected.
1120
1124
 
@@ -1173,13 +1177,13 @@ class N2PModelContent:
1173
1177
  }
1174
1178
  envelopgroup = envelgroup_maping.get(envelgroup, EnvelopGroup.ByContour)
1175
1179
 
1176
- # Genera una instancia de un N2LoadCase the VizzerClasses
1180
+ # Genera una instancia de un N2LoadCase de NaxToModel
1177
1181
  cs_lc = N2LoadCase(self.__vzmodel, name, formula, True, envelopgroup, False, envelopcriteria)
1178
1182
 
1179
1183
  # Método de N2LoadCase que pone todoo en su sitio
1180
1184
  cs_lc.RecalculateLCInfo2Formule()
1181
1185
 
1182
- # Se transforma el caso de carga de VizzerClasses en un N2PLoadCase de python
1186
+ # Se transforma el caso de carga de NaxToModel en un N2PLoadCase de python
1183
1187
  py_lc = N2PLoadCase(cs_lc.ID, cs_lc.IDOriginal, cs_lc.Increments, cs_lc.IncrementsNumberList, cs_lc.IsComplex,
1184
1188
  cs_lc.TypeLoadCase, cs_lc.Name, cs_lc.Results, cs_lc.SolutionType, cs_lc.Solver, self, cs_lc)
1185
1189
 
@@ -1227,7 +1231,7 @@ class N2PModelContent:
1227
1231
  componentssections: str -> Formula with the components and the section desired. Each component can have
1228
1232
  several sections, and the structure must be: <ComopnentName:X#Y#Z#> where X, Y, Z are the names of the
1229
1233
  section. After each name of section there must be an #, even if there is only one. Example:
1230
- "<VONMISES:Z1#Z2#>,<MAX_SHEAR:Z1#Z2#>"
1234
+ "<VONMISES:Z1#Z2#>,<MAX_SHEAR:Z1#Z2#>". If there is no section, use NONE#: "<FX:NONE#>,<FY:NONE#>"
1231
1235
 
1232
1236
  ifenvelope: bool -> Parameter to ask only for the results of the envelope of the load cases
1233
1237
 
@@ -1289,9 +1293,10 @@ class N2PModelContent:
1289
1293
  lcs = [int(lc.split(":")[0][3:]) for lc in lc_incr.split(",")]
1290
1294
  components = [c.split(":")[0][1:] for c in componentssections.split(",")]
1291
1295
  for lc in lcs:
1292
- A = self.get_load_case(lc).get_result(result).Components.keys()
1293
- if not all(c in self.get_load_case(lc).get_result(result).Components.keys() for c in components):
1294
- N2PLog.Error.E312()
1296
+ all_comps = chain(self.get_load_case(lc).get_result(result).Components.keys(),
1297
+ self.get_load_case(lc).get_result(result).DerivedComponents.keys())
1298
+ if not all(c in all_comps for c in components):
1299
+ N2PLog.Error.E312(lc, result)
1295
1300
  return "ERROR"
1296
1301
  except:
1297
1302
  N2PLog.Error.E313()
@@ -1381,18 +1386,20 @@ class N2PModelContent:
1381
1386
  N2PLog.Error.E310()
1382
1387
  return None
1383
1388
 
1389
+ n2pcomp = aux_lc.get_result(result).get_component(component)
1390
+
1384
1391
  # Aqui se llama la funcion de verdad que es un metodo de N2PComponent. Se llama a ella porque hace uso de otras
1385
1392
  # funciones ya definidas (n2paraminputresult) en la clase y es mejor no repetir codigo.
1386
- return aux_lc.get_result(result).get_component(component)._get_result_by_LCs_Incr(list_lc_incr,
1387
- sections,
1388
- aveSections,
1389
- cornerData,
1390
- aveNodes,
1391
- variation,
1392
- realPolar,
1393
- coordsys,
1394
- v1,
1395
- v2)
1393
+ return n2pcomp._get_result_by_LCs_Incr(list_lc_incr,
1394
+ sections,
1395
+ aveSections,
1396
+ cornerData,
1397
+ aveNodes,
1398
+ variation,
1399
+ realPolar,
1400
+ coordsys,
1401
+ v1,
1402
+ v2)
1396
1403
 
1397
1404
  # ------------------------------------------------------------------------------------------------------------------
1398
1405
 
@@ -22,7 +22,7 @@ def py_ver_comp() -> None:
22
22
 
23
23
  # Funcion que devuelve la ruta donde se encuentran las librerias de NaxTo----------------------
24
24
  def vizzer_libs() -> list[str, ...]:
25
- """Funcion que devuelve las rutas donde se encuentran las librerias de VizzerClasses. Si hay varias versiones
25
+ """Funcion que devuelve las rutas donde se encuentran las librerias de NaxToModel. Si hay varias versiones
26
26
  puede haber varias rutas.
27
27
 
28
28
  ----------
@@ -32,7 +32,7 @@ def vizzer_libs() -> list[str, ...]:
32
32
  """
33
33
  vizzer_libs = []
34
34
 
35
- # Miro en LOCAL MACHINE, donde está instalado el NAXTOVIEW. Ahí se busca la libreria de VizzerClasses.
35
+ # Miro en LOCAL MACHINE, donde está instalado el NAXTOVIEW. Ahí se busca la libreria de NaxToModel.
36
36
  key_id = winreg.HKEY_LOCAL_MACHINE
37
37
 
38
38
  try:
@@ -154,18 +154,52 @@ def destroy_register() -> None:
154
154
 
155
155
 
156
156
  # ----------------------------------------------------------------------------------------------------------------------
157
- def compatible_vizzer(vizzer_libs: list) -> str:
158
- """Returns the path of the VizzerClasses this NaxToPy version is compatible with"""
157
+ def compatible_vizzer(vizzer_libs: list) -> tuple[str, bool]:
158
+ """Returns the path of the NaxToModel this NaxToPy version is compatible with"""
159
159
 
160
+ # Se busca si alguna de las rutas contiene la version para la que esta preparado esta version
161
+ for lib in vizzer_libs:
162
+ if NAXTO_VERSION in lib:
163
+ lib_path = lib + "\\" + VIZZER_CLASSES_DLL
164
+
165
+ # Si alguna es de esta version hay que ver si el assembly, que cambia con cada step es compatible.
166
+ # Previamente se verifica que el archivo existe:
167
+ if os.path.exists(lib_path):
168
+ versionInfo = FileVersionInfo.GetVersionInfo(lib_path)
169
+ assemblyVersion = versionInfo.FileVersion
170
+
171
+ # Si la version es compatible se devuelve la ruta y un boleano indicando si es compatible
172
+ if assemblyVersion in VIZZER_COMPATIBILITY:
173
+ return lib_path, True
174
+
175
+ N2PLog.Warning.W104(NAXTO_VERSION)
176
+ # Aunque la version este bien, el assembly no. Puede que de un step a otro no haya compatibilidad.
177
+ backup = ""
178
+
179
+ # Comprobamos si hay alguna version que contenga una dll compatible
160
180
  for lib in vizzer_libs:
161
181
  lib_path = lib + "\\" + VIZZER_CLASSES_DLL
182
+ if not os.path.exists(lib_path):
183
+ continue
162
184
  versionInfo = FileVersionInfo.GetVersionInfo(lib_path)
163
185
  assemblyVersion = versionInfo.FileVersion
164
186
 
165
- if assemblyVersion == VIZZER_ASSEMBLY:
166
- return lib_path
187
+ if not backup:
188
+ backup = lib_path
189
+
190
+ if assemblyVersion in VIZZER_COMPATIBILITY:
191
+ return lib_path, True
192
+
193
+ N2PLog.Warning.W105()
194
+
195
+ # Si ninguna libreria es compatible se prueba con una de ellas, la primera que exista. Pero se indica que no es
196
+ # compatible. Mas adelante se comprubea si dentro de la libreria se indica que esta version de NaxToPy es compatible
197
+ # con ella
198
+ if backup:
199
+ return backup, False
200
+ else:
201
+ N2PLog.Critical.C110(VERSION, NAXTO_VERSION)
167
202
 
168
- N2PLog.Critical.C109(VERSION, VIZZER_ASSEMBLY)
169
203
  # sys.exit()
170
204
  # ---------------------------------------------------------------------------------------------
171
205
 
@@ -173,14 +207,15 @@ def compatible_vizzer(vizzer_libs: list) -> str:
173
207
  def _naxto_gen(vizzer: str) -> str:
174
208
  dir_viz = os.path.dirname(vizzer)
175
209
  if "GIT_REPOSITORIES" in dir_viz:
176
- return os.path.join(r"C:\GIT_REPOSITORIES\NAXTO\NAXTOLibsDebug\NAXLicense\v.3.0", "IdaeroLicense.dll")
177
- return os.path.join(dir_viz, "IdaeroLicense.dll")
210
+ return os.path.join(r"C:\GIT_REPOSITORIES\NAXTO\NAXTOLibsDebug\NAXLicense\v.4.0", "NaxToLicense.dll")
211
+ return os.path.join(dir_viz, "NaxToLicense.dll")
178
212
 
179
213
 
180
- # Inicializador para encontrar la libreria de VizzerClasses
214
+ # Inicializador para encontrar la libreria de NaxToModel
181
215
  def __reference_finder():
182
216
  # La ruta cambia si se tiene el repositorio de NaxToView
183
217
  developer_vizzer = DEVELOPER_VIZZER + "\\" + VIZZER_CLASSES_DLL
218
+ compatible = True
184
219
 
185
220
  # Si se crea un .exe queremos que encuentre unas nuevas librerias distribuibles, que estarán en la carpeta temporal que se
186
221
  # crea cuando se ejecuta el .exe. Tampoco se ejecutan los modulos del reference finder
@@ -188,7 +223,7 @@ def __reference_finder():
188
223
  destroy_register()
189
224
  create_register()
190
225
  exe_dir = sys._MEIPASS
191
- vizzer_path = exe_dir + "\\bin\\VizzerClasses.dll"
226
+ vizzer_path = exe_dir + "\\bin\\NaxToModel.dll"
192
227
  N2PLog.Info.I107()
193
228
 
194
229
  elif os.path.isfile(developer_vizzer):
@@ -203,21 +238,28 @@ def __reference_finder():
203
238
  destroy_register()
204
239
  # Compruebo que la version de python es compatible
205
240
  py_ver_comp()
206
- # Busco todas las vizzerclasses
241
+ # Busco todas las NaxToModel
207
242
  list_libs = vizzer_libs()
208
- # Devuelvo el path de la vizzerclasses que es compatible con NaxToPy
209
- vizzer_path = compatible_vizzer(list_libs)
243
+
244
+ vizzer_path, compatible = compatible_vizzer(list_libs)
210
245
 
211
246
  # Llamada a las librerias
212
247
  try:
213
248
  clr.AddReference(vizzer_path)
249
+ if not compatible:
250
+ from NaxToModel import Global
251
+ if VERSION in list(Global.NAXTOPY_COMPATIBILITY):
252
+ pass
253
+ else:
254
+ N2PLog.Critical.C113(vizzer_path, VERSION, list(Global.NAXTOPY_COMPATIBILITY))
255
+ sys.exit()
214
256
  N2PLog.Info.I109()
215
257
  N2PLog.Debug.D101(vizzer_path)
216
258
  naxto_c = _naxto_gen(vizzer_path)
217
259
  clr.AddReference(naxto_c)
218
260
  except:
219
261
  N2PLog.Critical.C103()
220
- # sys.exit("C103: THE LIBRARY 'VizzerClasses.dll' COULDN'T BE LOADED CORRECTLY")
262
+ # sys.exit("C103: THE LIBRARY 'NaxToModel.dll' COULDN'T BE LOADED CORRECTLY")
221
263
 
222
264
  N2PLog.Info.I100()
223
265
  # ---------------------------------------------------------------------------------------------
@@ -10,7 +10,7 @@ from NaxToPy.Core.N2PModelContent import N2PElement
10
10
  class N2PUpdateFastener:
11
11
  """
12
12
  This class stores information about fasteners and provides methods to update their stiffness and generate a new
13
- bdf file with the updated data.
13
+ FEM Input File (.bdf, .fem, .dat, etc.) file with the updated data.
14
14
 
15
15
  Fastener information can be input either as a dictionary (for a single type of fastener) or as a list of dictionaries
16
16
  (for multiple types). Each dictionary must include at least the keys for diameter ["D"] and elastic modulus ["E"].
@@ -25,9 +25,39 @@ class N2PUpdateFastener:
25
25
  of ID lists to ensure proper mapping of variables.
26
26
 
27
27
  Supported methods for stiffness calculation include HUTH, TATE_ROSENFELD, SWIFT, BOEING, GRUMMAN, and NELSON.
28
+
29
+ Example:
30
+ Example 1:
31
+
32
+ >>> import NaxToPy as n2p
33
+ >>> model = n2p.load_model("model.dat")
34
+ >>> info1 = {"D": 4.8,
35
+ ... "E": 110000}
36
+ >>> info2 = {"D": 7.2,
37
+ ... "E": 70000,
38
+ ... "connection_type": "rivet",
39
+ ... "shear_type": "double"}
40
+ >>> ele1 = [1000, 1001, 1002]
41
+ >>> ele2 = [2000, 2001, 2002]
42
+ >>> update1 = N2PUpdateFastener(model, [info1, info2], [ele1, ele2], "BOEING")
43
+ >>> update1.calculate() # This will update the model in memory with the information of the object.
44
+ >>> model.ModelInputData.rebuild_file() # With the model updated, the model is rewritten
45
+
46
+ Example 2:
47
+
48
+ >>> model = n2p.load_model("model.dat")
49
+ >>> update2 = N2PUpdateFastener(model, {}) # Create the object without information
50
+ >>> update2.IDList = [3000, 3001, 3002] # Add the information using it properties
51
+ >>> update2.StiffnessMethod = "GRUMMAN"
52
+ >>> update2.FastenerInformation = {3000: {"D": 4.8, "E": 70000, "connection_type": "rivet"},
53
+ ... 3001: {"D": 6.8, "E": 70000, "connection_type": "bolt"},
54
+ ... 3002: {"D": 7.2, "E": 70000, "shear_type": "double"}}
55
+ >>> update2.calculate() # This will update the model in memory with the information of the object.
56
+ >>> model.ModelInputData.rebuild_file() # With the model updated, the model is rewritten
57
+
28
58
  """
29
59
 
30
- def __init__(self,model: N2PModelContent, information: Union[dict, list], id_list: list = None,
60
+ def __init__(self, model: N2PModelContent, information: Union[dict, list], id_list: list = None,
31
61
  stiffness_method: str = "HUTH"):
32
62
  self.__model = model
33
63
  self.__stiffness_method = stiffness_method
@@ -94,13 +124,8 @@ class N2PUpdateFastener:
94
124
  self.__mapping_fastener_properties()
95
125
 
96
126
  def __mapping_fastener_properties(self):
97
-
98
- properties_map = {}
99
- for prop, ID in zip(self.__info_list, self.__id_list):
100
- for fastener in ID:
101
- properties_map[fastener] = prop
102
-
103
- self.__fastener_properties = properties_map
127
+ self.__fastener_properties = {fastener: prop for prop, IDs in zip(self.__info_list, self.__id_list) for fastener
128
+ in IDs}
104
129
 
105
130
  def __read_bolts(self, path: str) -> dict:
106
131
  """
@@ -3,7 +3,7 @@ Module that generates the envelope of points cloud.
3
3
  """
4
4
  import sys, os
5
5
  import numpy as np
6
- from VizzerClasses import N2Envelope
6
+ from NaxToModel import N2Envelope
7
7
  import System
8
8
  from NaxToPy.Core._AuxFunc._NetToPython import _nettonumpy, _numpytonet
9
9
  from NaxToPy.Core.Errors.N2PLog import N2PLog
@@ -97,14 +97,14 @@ def envelope_ndarray(array2D: np.ndarray) -> np.ndarray:
97
97
 
98
98
  # _numpytonet(array2D) es una funcion que transforma un array de numpy en un array de .NET, en este caso en un
99
99
  # System.Double[,]
100
- # Se llama a la funcion de envelope the vizzerclasses
100
+ # Se llama a la funcion de envelope de NaxToModel
101
101
  aux = N2Envelope.Calculate(_numpytonet(array2D), "all")
102
102
 
103
103
  # Se crea un array de numpy vacio de objetos. Tiene que ser de objetos porque se mezclan variables, ya que en la
104
104
  # columna 0 habra enteros mientras que en las demas habra columnas
105
105
  envel = np.zeros((aux.GetLength(0), aux.GetLength(1)), dtype=object)
106
106
 
107
- # Relleno el array de numpy con los valores obtenidos del array de vizzerclasses
107
+ # Relleno el array de numpy con los valores obtenidos del array de NaxToModel
108
108
  for i in range(aux.GetLength(0)):
109
109
  for j in range(aux.GetLength(1)):
110
110
  # qhull devulve los indices empezando por 1. Necesitamos que lo devuelva por 0.
@@ -6,6 +6,7 @@ import sys
6
6
 
7
7
  import NaxToPy.Core.Reference_Finder.__Reference_Finder as RF
8
8
  from NaxToPy.Core.Errors.N2PLog import N2PLog
9
+ from NaxToPy.Core.Constants.Constants import VIZZER_CLASSES_DLL
9
10
 
10
11
 
11
12
  # Funcion que busca el path del icono de NaxToPy -----------------------------------------------------------------------
@@ -169,7 +170,7 @@ def n2ptoexe(path: str, console: bool = True, solver: str = "ALL", abaqusversion
169
170
  if __busca_n2p(path):
170
171
 
171
172
  libs_paths = RF.vizzer_libs()
172
- libs_path = RF.compatible_vizzer(libs_paths)[:-18]
173
+ libs_path = RF.compatible_vizzer(libs_paths)[0][:-(len(VIZZER_CLASSES_DLL) + 1)]
173
174
  dll_list = __list_ext_libs(libs_path, solver, abaqusversion)
174
175
 
175
176
 
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: NaxToPy
3
- Version: 1.5.6
3
+ Version: 2.0.0
4
4
  Summary: Package for postprocessing FEM results in Python
5
5
  Home-page: https://www.idaerosolutions.com/Home/NaxToPy
6
6
  Download-URL: https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US
7
7
  Author-email: Idaero Solutions <manuel.sanchez@idaerosolutions.com>
8
- License: Copyright (c) 2023 Idaero Solutions
8
+ License: Copyright (c) 2024 Idaero Solutions
9
9
 
10
10
  This freeware license agreement (“agreement”) is a legally binding contract
11
11
  between the individual who downloads the software (“you”) and the licensor,
@@ -146,8 +146,9 @@ links on the left).
146
146
 
147
147
  **NaxToPy** is a powerful tool for FEM analysis post-processing!
148
148
 
149
- **CAUTION:** This version is only compatible with **NaxTo 2024.0.5**.
150
- Check in _Programs and Features_ the NaxTo version that is installed.
149
+ **CAUTION:** To use NaxToPy, [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US) must be installed.
150
+ This version is compatible with **NaxTo 2024.1**. It may be compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).
151
+ Check in _Programs and Features_ the NaxTo version that is installed.
151
152
 
152
153
  ## Installation
153
154
 
@@ -254,6 +255,11 @@ To see previous version see the pre-release versions in https://test.pypi.org/pr
254
255
  1. The method new_envelope_loadcase() now has the option to choose the envelope group. Which means the user can ask for
255
256
  the LoadCases that are critical or the Increment that is critical instead of the value.
256
257
 
258
+ ### v.2.0.0
259
+ 1. Changes made to align the library with updates in lower-level dependencies.
260
+ 2. New internal methods to look for the compatibility with low-level dependencies.
261
+ 3. The name of the .log is now NaxToPy_Year-Month-Day.log.
262
+
257
263
  # Documentation
258
264
 
259
265
  **NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
File without changes
File without changes
File without changes
File without changes