Create 3D Block & Cylinder by giving overall dimension

Hi, I want to make journal to create Block and Cylinder 3D models by giving overall dimensions manually. Can you please help me.

The following journal prompts for the X, Y, and Z dimensions of a block and then creates the block (with the origin corner at (0,0,0)). I recorded a journal while using the "block" command then added in the user input from
https://nxjournaling.com/content/user-input-input-boxes
and finally found the section of code that specified the size of the block and replaced the recorded values with those input by the user.

It doesn't do much error checking, but should illustrate the overall process.

Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.UF

Module Module210

Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession
Dim theUISession As UI = UI.GetUI
Dim lw As ListingWindow = theSession.ListingWindow

Sub Main(args As String())
lw.Open()

Dim answer As String = ""
Dim Xdim As Double = 0
Dim Ydim As Double = 0
Dim Zdim As Double = 0

'loop until there is valid input
Do
answer = NXInputBox.GetInputString("Enter a number", "Length in X direction?", " ")
'if cancel is pressed, exit sub
If answer = "" Then Exit Sub
Loop Until Double.TryParse(answer, Xdim)

Do
answer = NXInputBox.GetInputString("Enter a number", "Length in Y direction?", " ")
'if cancel is pressed, exit sub
If answer = "" Then Exit Sub
Loop Until Double.TryParse(answer, Ydim)

Do
answer = NXInputBox.GetInputString("Enter a number", "Length in Z direction?", " ")
'if cancel is pressed, exit sub
If answer = "" Then Exit Sub
Loop Until Double.TryParse(answer, Zdim)

'code below from a slightly modified recorded journal
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "my block")

Dim nullNXOpen_Features_Feature As NXOpen.Features.Feature = Nothing

Dim blockFeatureBuilder1 As NXOpen.Features.BlockFeatureBuilder = Nothing
blockFeatureBuilder1 = theSession.Parts.Work.Features.CreateBlockFeatureBuilder(nullNXOpen_Features_Feature)

blockFeatureBuilder1.BooleanOption.Type = NXOpen.GeometricUtilities.BooleanOperation.BooleanType.Create

Dim targetBodies1(0) As NXOpen.Body
Dim nullNXOpen_Body As NXOpen.Body = Nothing

targetBodies1(0) = nullNXOpen_Body
blockFeatureBuilder1.BooleanOption.SetTargetBodies(targetBodies1)

blockFeatureBuilder1.BooleanOption.Type = NXOpen.GeometricUtilities.BooleanOperation.BooleanType.Create

Dim targetBodies2(0) As NXOpen.Body
targetBodies2(0) = nullNXOpen_Body
blockFeatureBuilder1.BooleanOption.SetTargetBodies(targetBodies2)

blockFeatureBuilder1.Type = NXOpen.Features.BlockFeatureBuilder.Types.OriginAndEdgeLengths

Dim originPoint1 As NXOpen.Point3d = New NXOpen.Point3d(0.0, 0.0, 0.0)
'blockFeatureBuilder1.SetOriginAndLengths(originPoint1, "100", "80", "10")
blockFeatureBuilder1.SetOriginAndLengths(originPoint1, Xdim.ToString, Ydim.ToString, Zdim.ToString)

blockFeatureBuilder1.SetBooleanOperationAndTarget(NXOpen.Features.Feature.BooleanType.Create, nullNXOpen_Body)

Dim feature1 As NXOpen.Features.Feature = Nothing
feature1 = blockFeatureBuilder1.CommitFeature()

blockFeatureBuilder1.Destroy()

End Sub

End Module