Hello,
In NX do we have the notion of Protection?!
Thanks in Advance,
Hello,
In NX do we have the notion of Protection?!
Thanks in Advance,
Hi,I want to ask a question.
When excute the swept command,if the sections can be selected from local folder.
I mean save the section file to local folder in advance for selecting.
if it is possible,How it can be done?
Thanks
I am having a really hard time getting a body to move to layer 255. I create a new component within an assembly, and mirror a body within the new component. Then I attempt to move the original body to layer 255 and it will not work.
If my assembly is more than 2 levels deep, then I can make the component's parent my display part, and it appears correctly. While I do these operations, I have the highest component available in the assembly my display part. Does anyone have any ideas why this might happen?
I attempted to grab/clean up some of the code snippets I've tried to accomplish this, they are below.
Dim objs As DisplayableObject = CType(bod, DisplayableObject) objs.Layer = 255 objs.RedisplayObject()
displayPart.Layers.ApplyMoveToLayerToOwningParts(255, arrBodies)
Dim objs() As NXObject Dim lay As Integer Dim prt As Part = CType(obj.OwningPart, Part) Dim objs() As DisplayableObject = {CType(obj, DisplayableObject)} prt.Layers.MoveDisplayableObjects(lay, objs)
How I can cast object type NXOpen.Features.TroughtCurves to type NXOpen.body
I make a function to join two solid, the solid are:
throughCurvesBuilder1.BodyPreference = Features.ThroughCurvesBuilder.BodyPreferenceTypes.Solid
Journalist save the following option
Dim body1 As Body = CType(workPart.Bodies.FindObject("THRU_CURVE(39)"), Body)
but I change for:
Dim body1 As Body
body1 = Sold1
I receive the following error
"cast object type NXOpen.Features.TroughtCurves to type NXOpen.body"
I send two Function(SupThroughCurve,UnionSolidos), one make TroughCurve Solid object and the other receive this Object to joing
Public Function SupThroughCurve(ByVal Sec01 As Object, ByVal Sec02 As Object) As Object
Dim nullFeatures_Feature As Features.Feature = Nothing
Dim throughCurvesBuilder1 As Features.ThroughCurvesBuilder
throughCurvesBuilder1 = workPart.Features.CreateThroughCurvesBuilder(nullFeatures_Feature)
throughCurvesBuilder1.PreserveShape = False
throughCurvesBuilder1.PatchType = Features.ThroughCurvesBuilder.PatchTypes.Multiple
throughCurvesBuilder1.Alignment.AlignCurve.DistanceTolerance = 0.0254
throughCurvesBuilder1.Alignment.AlignCurve.ChainingTolerance = 0.02413
throughCurvesBuilder1.SectionTemplateString.DistanceTolerance = 0.0254
throughCurvesBuilder1.SectionTemplateString.ChainingTolerance = 0.02413
throughCurvesBuilder1.Alignment.AlignCurve.AngleTolerance = 0.5
throughCurvesBuilder1.SectionTemplateString.AngleTolerance = 0.5
'throughCurvesBuilder1.BodyPreference = Features.ThroughCurvesBuilder.BodyPreferenceTypes.Sheet
throughCurvesBuilder1.BodyPreference = Features.ThroughCurvesBuilder.BodyPreferenceTypes.Solid
Dim section1 As Section
section1 = workPart.Sections.CreateSection(0.0, 0.0, 0.0)
throughCurvesBuilder1.SectionsList.Append(section1)
section1.SetAllowedEntityTypes(Section.AllowTypes.CurvesAndPoints)
'Procesa la seccion1
'*******************
Dim curves1(0) As IBaseCurve
'Dim arc1 As Arc = CType(workPart.Arcs.FindObject("ENTITY 5 37 1"), Arc)
Dim arc1 As NXopen.Arc
arc1 = Sec01
curves1(0) = Sec01
Dim curveDumbRule1 As CurveDumbRule
curveDumbRule1 = workPart.ScRuleFactory.CreateRuleBaseCurveDumb(curves1)
section1.AllowSelfIntersection(False)
Dim rules1(0) As SelectionIntentRule
rules1(0) = curveDumbRule1
Dim nullNXObject As NXObject = Nothing
Dim helpPoint1 As Point3d = New Point3d(0.0, 0.0, 0.0)
section1.AddToSection(rules1, arc1, nullNXObject, nullNXObject, helpPoint1, Section.Mode.Create, False)
Dim sections1(0) As Section
sections1(0) = section1
throughCurvesBuilder1.Alignment.SetSections(sections1)
'Procesa la seccion2
'*******************
Dim section2 As Section
section2 = workPart.Sections.CreateSection(0.0, 0.0, 0.0)
throughCurvesBuilder1.SectionsList.Append(section2)
section2.SetAllowedEntityTypes(Section.AllowTypes.CurvesAndPoints)
Dim curves2(0) As IBaseCurve
'Dim arc2 As Arc = CType(workPart.Arcs.FindObject("ENTITY 5 35 1"), Arc)
Dim arc2 As NXopen.Arc
arc2 = Sec02
curves2(0) = Sec02
Dim curveDumbRule2 As CurveDumbRule
curveDumbRule2 = workPart.ScRuleFactory.CreateRuleBaseCurveDumb(curves2)
section2.AllowSelfIntersection(False)
Dim rules2(0) As SelectionIntentRule
rules2(0) = curveDumbRule2
Dim helpPoint2 As Point3d = New Point3d(0.0, 0.0, 0.0)
section2.AddToSection(rules2, arc2, nullNXObject, nullNXObject, helpPoint2, Section.Mode.Create, False)
Dim sections2(1) As Section
sections2(0) = section1
sections2(1) = section2
throughCurvesBuilder1.Alignment.SetSections(sections2)
Dim feature1 As Features.Feature
feature1 = throughCurvesBuilder1.CommitFeature()
throughCurvesBuilder1.Destroy()
Return feature1
End Function
Public Function UnionSolidos(ByVal Sold1 As Object, ByVal Sold2 As Object) As NXObject
Dim nullFeatures_BooleanFeature As Features.BooleanFeature = Nothing
Dim booleanBuilder1 As Features.BooleanBuilder
booleanBuilder1 = workPart.Features.CreateBooleanBuilderUsingCollector(nullFeatures_BooleanFeature)
Dim scCollector1 As ScCollector
scCollector1 = booleanBuilder1.ToolBodyCollector
Dim booleanRegionSelect1 As GeometricUtilities.BooleanRegionSelect
booleanRegionSelect1 = booleanBuilder1.BooleanRegionSelect
booleanBuilder1.Tolerance = 0.0254
booleanBuilder1.Operation = Features.Feature.BooleanType.Unite
'Solido1 receptor
'***************
'Dim body1 As Body = CType(workPart.Bodies.FindObject("THRU_CURVE(39)"), Body)
Dim body1 As Body
body1 = Sold1
Dim added1 As Boolean
added1 = booleanBuilder1.Targets.Add(body1)
Dim targets1(0) As TaggedObject
targets1(0) = body1
booleanRegionSelect1.AssignTargets(targets1)
Dim scCollector2 As ScCollector
scCollector2 = workPart.ScCollectors.CreateCollector()
Dim bodies1(0) As Body
'Solido2
'****************
'Dim body2 As Body = CType(workPart.Bodies.FindObject("THRU_CURVE(40)"), Body)
Dim body2 As Body
body2 = Sold2
bodies1(0) = body2
Dim bodyDumbRule1 As BodyDumbRule
bodyDumbRule1 = workPart.ScRuleFactory.CreateRuleBodyDumb(bodies1)
Dim rules1(0) As SelectionIntentRule
rules1(0) = bodyDumbRule1
scCollector2.ReplaceRules(rules1, False)
booleanBuilder1.ToolBodyCollector = scCollector2
Dim targets2(0) As TaggedObject
targets2(0) = body1
booleanRegionSelect1.AssignTargets(targets2)
Dim nXObject1 As NXObject
nXObject1 = booleanBuilder1.Commit()
booleanBuilder1.Destroy()
Return nXObject1
End Function
Someone can help me
Hi! I'm brand new to journaling. I'm just starting to read through some of the tutorials here so sorry if this is a super easy question to answer.
I have a folder of STL files that I would like to convert to .prt files. I'd like for the .prt files to have the same name as they originally had as the STL file, and for it to save to the same location that the STL file is in (or, in new folder with "_PRT" appended to the original name of the folder). I would also like to perform some operations on the files before saving them such as changing the color, transparency, and fitting it to the screen.
I found this:
http://www.nxjournaling.com/content/process-files-directory
Which seems very useful and very much like what I am trying to do. Any tips on modifying this code to do what I am trying to do?
Thanks!
I am trying to get the input curves from an extrude feature. I've managed to grab the feature, and create an extrude builder from it. I can access the section but I am not sure how to go from there to curves. Does anyone have any ideas? Recording a journal gets me some of this code:
Dim extrude1 As Features.Extrude = CType(wrkPrt.Features.FindObject("EXTRUDE(6)"), Features.Extrude) wrkPrt.Features.SetEditWithRollbackFeature(extrude1) nxSes.UpdateManager.InterpartDelay = True Dim mirrorCurve1 As Features.MirrorCurve = CType(wrkPrt.Features.FindObject("MIRROR_CURVE(5)"), Features.MirrorCurve) mirrorCurve1.MakeCurrentFeature() If Not wrkPrt.Preferences.Modeling.GetHistoryMode Then Throw (New Exception("Create or edit of a Feature was recorded in History Mode but playback is in History-Free Mode.")) End If Dim extrudeBuilder1 As Features.ExtrudeBuilder extrudeBuilder1 = wrkPrt.Features.CreateExtrudeBuilder(extrude1) Dim section1 As Section section1 = extrudeBuilder1.Section section1.PrepareMappingData()
As the subject hints, I am trying to remove a newline character from cells in a tabular note and replace them with a space. For example:
Sub
Assembly
to
Sub Assembly
How can I do this? I have tried:
cellText.Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbCrLf, " ").Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ")
But no dice. Any help would be greatly appreciated.
Hi
the input to below function curv is some drafting (curve,face,line etc) from drafting view
static tag_t ask_subassy(tag_t curv)
{
tag_t part_occ=NULL_TAG;
tag_t
*children;
int n,ii;
bool found=false;
//tag_t root_comp=NULL_TAG;
tag_t part = UF_PART_ask_display_part();
tag_t root_assy=UF_ASSEM_ask_root_part_occ(part);
int irc=UF_ASSEM_ask_parent_component(curv,&part_occ);
n= UF_ASSEM_ask_all_part_occ_children(root_assy,&children);
for ( ii = 0; ii < n; ii++)
{
if(part_occ==children[ii])
{
found=true;
return part_occ;
}
}
if (n > 0) UF_free(children);
if(!found)
{ask_subassy(part_occ);}
//return NULL_TAG;
}
i am looking for tag of first level subassembly.facing some prob. please have a look
Hello,
I am attempting to edit an extrude feature, and a reference edge from the extrude feature gets destroyed, as does the Edge Blend used later on in the part navigator tree. I anticipate this happening and have attempted a few things to suppress the error but can't seem to get it suppressed.
If TypeOf fts(index) Is Extrude Then For Each ftr As Feature In fts(index).GetChildren nxSession.UpdateManager.SetUpdateFailureAction(ftr, Update.FailureOption.AcceptAll) Next ExtrudeModifier(fts(index), fts(index - 1), fts(fts.Length - 1) End If
In the ExtrudeModifier, there are some code calls I follow from the journal I recorded, does anyone know if these are the right calls to make?
nxSession.UpdateManager.InterpartDelay = True prevFtr.MakeCurrentFeature() workPsrt.Features.SetEditWithRollbackFeature(extrude1)
Hello all,
I am struggling writing a journal to atomized a task that I have to do a lot of times manually .
Read in a vector( from excel or a text file), change an expresión looping through the values of the elements of the vector ( 10 values )and write out measurements in a spreadsheet or text .
I would really appreciate your help .
I use feature based machining in NX (find features). I am programming an EDM drill. I use NX only for positioning and my post spits out all of the necessary macro commands for the machine. I need to find a way to access the "depth" attribute that is associated with the feature. There is no post builder variable associated with this value. I can see the value under the features tab in manufacturing so I assume this value is stored somewhere. I can also alter this value. Does anyone have any experience with setting post builder variables with journals/API? Thanks!!
Hello,
I'm trying to create a script to project all sheet edges from a group of surfaces that are in a feature group onto a surface.
I'm strolling to access the features inside a group.
I know the group name as a string and the destination surface name as a string. Now I'm trying to loop through all the features inside the group, and if the feature is a sheet project its edges.
I was trying to use:
.AskSetFromName to access the group and them use
.IsFeatureASetMember or .AskAllMembersOfSet to loop through the group and project the sheet edges if the feature is a sheet.
But I can't use any of the group functions, i always get a errors.
hope you can help me
cheers
kico
Hello,
i am creating a plant which contains of components.
Constraints are used to connection the separate components with each other.
I used a DatumAxis to identify, when i have to reverse the constraints.
So my problem is, after connect to components with each other, the datumaxis didn't not update his data. He still has the old values in.
Only after the action-call he will update his new Values.
The follow methods i have already try, without success:
Update.DoAssemblyConstraintsUpdate
Update.DoUpdate
Update.MakeUpToDate
Has anyone an idea?
to all
a really stupid question.
I want to "force" the 'theyunit' of an AFU record to be exported in 'g'. How do I set it up? I think it's an enumeration. I can the check the value when I select the record as follows
theAFUData.GetAxisDefinition(theAbscissaType, thexunit, theOrdinateType, theYunit) theLW.WriteLine("DEBUG: Y unit: " & theyunit.ToString)
I then do a check
If theyunit.ToString.Contains("Acceleration") Then theyunit = NXOPEN.CAE.XyFunctionUnit.AccelerationGs 'any acceleration record will be forced to 'g', any other type is ignored and left as-is
The following appears to be correct for some type of records but I did a test on a 'PowerSpectralDensity' and it doesn't pick it up!
Thanks
Regards
Hi all together,
I tried to create a tool for my drawings. There are some isometric views on the page.
If I need to rotate the modeling view of on draftingview all the other views should also turn around in the same way.
So I need to aling all views to one selected.
To turn around I change orientation in style of the view.
I recorded a journal to get a solution but I always get an error by changing orientation of workview.
Can somebody help please.
Hagen
Hi ,
There are number of views available in one sheet and I want to get active view.
So how to get it thought journal?
Hi,
i am trying to get projectionplanenormal and projectionplane of drawingview.
There is a way in catia to get it as mentioned in below code.
DrawingView.GenerativeBehavior.GetProjectionPlaneNormal Xn, Yn, Zn
DrawingView.GenerativeBehavior.GetProjectionPlane x(1), Y(1), Z(1), x(2), Y(2),Z(2)
Is there any equivalent method in NX to get it?
Hi guys, I am converting Grip code to NXOpen C++ code. Here I am facing problem in assigning GPA values in NXOpen c++. For example &ENTCLR, &GBSTR..etc. Can anyone help me how to call these GPA values in NXOpen c++(&ENTCLR , &GBSTR..)...
Hi,
I have made one block in part and then created view of that part in drawing.
Now I am trying to get co-ordinates value with respect to that particular view when user will select screen position in that view.
I am able to get point co-ordinates with respect to drawing.
By using below code i am able to get origin of activated view.
Module Module1 Dim theSession As Session = Session.GetSession()Dim workPart As Part = theSession.Parts.WorkDim theUI As UI = UI.GetUI Sub Main() Dim X, Xx, Y, Z AsDouble If IsNothing(theSession.Parts.Work)Then'active part requiredReturnEndIf Dim dwgsheet As Drawings.DrawingSheet dwgsheet = workPart.DrawingSheets.CurrentDrawingSheet ForEach View As Drawings.DraftingViewIn dwgsheet.SheetDraftingViewsIf View.IsActiveForSketching=TrueThen X = View.AbsoluteOrigin.X Y = View.AbsoluteOrigin.Y Z = View.AbsoluteOrigin.Z' MsgBox(CStr(X))MsgBox(CStr(Xx))EndIf NextEndSub EndModule
Hello Community,
I spent over 10 hours of my life trying to get working with NXObjects generated by a feature builder on NXOpen Journal with VB code.
To be more simply I would like to explain my example:
1. Insert a Datum CSYS --> done;
2. Create section 1 --> done;
3. Extrude the section 1 --> done;
4. Remove parameters of the extrusion 1 --> done;
5. I see Body(1) on the Part Navigator, as expected;
6. Create section 2 --> done;
7. Extrude the section 2 --> done;
8. Remove parameters of the extrusion 2 --> done;
9. I see Body(2) on the Part Navigator, as expected;
Body(1) and Body(2) are two sheet bodies and my goal is to merge these two unparametrized sheet bodies in order to obtain only one merged sheet with the sew command.
To do this I recorder a new journal with the sewbuilder flow but it only works with the Ctype(FindObject...) command. When I edit the line to identify the two bodies Body(1) and Body(2), the journal stops working.
I declared B1 as Body(1) in this way:
RemoveParametersBuilder1.commit()Dim B1 As NXOpen.Body= RemoveParametersBuilder1.GetObject()
In the same way (changing the idex 1 with 2) I declared B2 as Body(2).
What is wrong? I don't find anything to be helpful.
Thank you in advance,
kalo86