Logic Blocks: Complete Beginner's Guide
Introduction
Logic Blocks are one of the most powerful automation features in Dietrich's timber construction software. They allow you to create reusable, parametric components that combine multiple elements into a single unit.
This guide will take you from basic concepts through practical applications, following a structured learning path designed for beginners.
What are Logic Blocks?
Definition
A Logic Block is a combination of components, machining processes, drawing elements, dimensions, and labels that work together as a single unit. Think of it as a "smart component" that can adapt to different situations based on parameters you define.
What Logic Blocks Combine
Logic Blocks can include:
3D Volumes and Objects - Beams, plates, library components
Machine Processes - Drillings, notches, cuts, custom tool paths
Drawing Elements - Lines, shapes, dimensions
Text and Labels - Annotations, part information
Smart Tags - Pre-defined processing operations
Key Characteristics
Logic Blocks are:
Re-calculable - Update automatically when conditions change
Editable - Modify parameters after insertion using function 7-9-4
Movable and Rotatable - Reposition as needed
Deletable - Remove as a complete unit
Disbandable - Break apart if needed (though this removes the smart functionality)
Why Use Logic Blocks?
Primary Benefits
Save Time - Automate repetitive tasks that would take hours manually
Ensure Consistency - Same parameters = same results every time
Reduce Errors - Calculations are handled automatically
Increase Flexibility - Easily adapt designs with variable inputs
Improve Productivity - Focus on design decisions, not repetitive modeling
Real-World Applications
Window and door assemblies with automatic framing
Connector systems (screws, bolts, metal plates) with automatic distribution
Bracing elements positioned and processed automatically
Drilling patterns with calculated spacing
Custom joinery with parametric dimensions
Time Savings Example
Manual process for adding 50 evenly-spaced drillings to a plate:
Measure total length
Calculate spacing
Mark each position
Insert each drilling individually
Time: 15-20 minutes
With a Logic Block:
Click start and end point
Set diameter and maximum spacing
Time: 30 seconds
Logic Block Components and Files
File Structure
Every Logic Block consists of multiple file types working together:
Primary File Types
Logic Block File
.ksz
Main logic block definition
Object Library
.gbi
3D components referenced by the logic block
Smart Tag File
.psl
Pre-defined process operations
Drawing Sections
.btz
2D drawing elements
Picture Files
.jpg, .png, etc.
Help images and icons
File Organization
Logic Blocks are stored in a hierarchical folder structure:
%DHPKOL% (System Logic Blocks Directory)
├── Windows/
│ ├── Rectangular/
│ │ ├── window_single_sash.ksz
│ │ ├── window_objects.gbi
│ │ └── help_image.jpg
│ └── Slanting/
├── Construction/
├── Custom/ (User Logic Blocks)
└── ...Important: When copying logic blocks, use the Mouse-Right functions to copy all linked data files together.
Logic Block Types
Logic Blocks are classified by type, which determines where and how they can be used.
Available Types
1. In Plan View
Modules: Floor plan, Floor decks, Floor design, Roof calculation, Roof design
Use: Insert elements visible in top-down view
Examples: Foundation layout, framing plans
2. In Wall
Modules: Floor plan, Wall design
Use: Insert elements into wall elevation
Examples: Bracing, backing blocks, electrical boxes
3. Insert in Wall Design
Modules: Wall design only
Use: More specialized wall-based operations
Examples: Complex connections, custom details
4. For Windows/Doors
Modules: Window and door input dialogs
Use: Automatically execute when placing openings
Examples: Frame extensions, sill details, slots in bottom plates
5. Insert in Roof Surface
Modules: Roof calculation, Roof design
Use: Elements that attach to roof planes
Examples: Dormer details, roof penetrations
6. Insert in Truss
Modules: Truss design, Floor plan, Roof calculation/design
Use: Truss-specific elements
Examples: Web bracing, heel details
7. Insert in Truss Design
Modules: Truss design
Use: Detailed truss modifications
Examples: Custom connections, reinforcement
8. At Points, Objects
Modules: D-CAM, Wall design, Floor design, Roof design, Truss design
Use: Maximum flexibility - insert anywhere by selecting points or objects
Examples: Drilling patterns, connector hardware, custom processes
Understanding Coordinate Systems
Coordinate systems are fundamental to how Logic Blocks work. Understanding them is crucial for creating and using logic blocks effectively.
Two Key Coordinate Systems
1. Basic Coordinate System (Basic CS)
Determined by: Logic block type and program module
Purpose: Defines the initial reference frame
Example: In wall design, the Basic CS is aligned with the wall face
2. Insertion Coordinate System (Insertion CS)
Defined in: The Basic CS (not the Global CS!)
How it's defined:
Using a positioning point and height origin, OR
Using three points (coordinates can come from calculations, variables, or user prompts)
Purpose: All further definitions inside the logic block refer to this coordinate system
Key Principle
All coordinates, positions, and orientations within a logic block are relative to the Insertion CS, not the global building coordinate system.
This is what makes logic blocks portable and reusable - they work the same way regardless of where in the building they're inserted.
Coordinate System Visualization
Global Building CS
└── Basic CS (determined by logic block type)
└── Insertion CS (defined within logic block)
└── All logic block elements positioned hereVariables in Logic Blocks
Variables are what make logic blocks parametric and flexible. They store values that control dimensions, quantities, positions, and behavior.
Calculations in Logic Blocks
Calculations are where the "logic" in Logic Blocks really comes to life. They perform mathematical operations, string manipulations, and conditional logic.
Debugging Calculations
When a logic block doesn't work as expected:
Check the Control File at
%DHPTMP%/KOLVariablen.logThis file lists all variables and calculations when the logic block is used
Look for variables with value
0or empty results - that's where the error isCommon issues:
Division by zero
Using undefined variables
Incorrect formula syntax
Using Existing Logic Blocks
Before creating new logic blocks, explore what's already available. Dietrich's provides hundreds of pre-built logic blocks.
Finding Logic Blocks
System Logic Blocks
Located in: %DHPKOL% (Program installation directory)
Main categories:
Windows (Rectangular, Slanting, Pointed)
Doors (Interior, Exterior, with fixed elements)
Construction (Connectors, brackets, hold-downs)
Processes (Drilling patterns, notches, slots)
Inserting Logic Blocks
General Method (Function 7-8-1):
Open the appropriate module (Wall design, Roof design, etc.)
Navigate to function 7-8-1 "Insert logic blocks at points, objects"
Browse to select the logic block
Follow the prompts (click points, select objects, enter variables)
Confirm insertion
For Windows/Doors:
Logic blocks execute automatically when placing windows or doors
Access additional logic blocks through "Further logic blocks" option in window/door dialog
Modifying Inserted Logic Blocks
Function 7-9-4: Re-position Logic Blocks
Use this to:
Change variable values
Adjust positioning
Switch to a different logic block while keeping inputs
Update calculations
Process:
Function 7-9-4
Select the inserted logic block
Dialog opens with current settings
Modify as needed
Confirm to recalculate
Re-reading Logic Blocks
Function 7-9-8: Read again and calculate
When a logic block definition is updated (new version), use this function to update all instances in your project:
Function 7-9-8
Select which logic blocks to update
System reads new definitions
Variable values are preserved
Logic blocks recalculate with new logic
Requirements:
Logic block must still be in same directory
File name must match exactly
Type must be the same
Number of prompt points/objects must match
Advanced Logic Block Features
Once you're comfortable with basics, these advanced features provide even more power.
Conditions
Conditions control whether elements are created or how they behave.
Syntax: Variable = Value or Variable <> Value
Comparison Operators:
=Equal to<>Not equal to<Less than>Greater than<=Less than or equal>=Greater than or equal
Examples:
VSink = Yes (Show element only when VSink variable equals "Yes")
VQuantity > 5 (Only if quantity is more than 5)
Lp0 >= 0.200 (Only if slice thickness is 200mm or more)Applying Conditions:
Objects: Condition determines if object is created
Processes: Condition determines if process is applied
Smart Tags: Condition determines if tag is executed
Component Definition
Turn a logic block into a Component for:
Separate part drawings
Dedicated part lists
Assembly documentation
Shop drawings
Settings:
"Create component": Yes
Prefix: e.g., "BR" for Brace
Component number: Automatic or manual
Coordinate system: Define with three points (0/0/0, 1/0/0, 0/1/0)
Views: Select which views to show in component drawings
Distribution with Tilde (~)
The tilde symbol ~ creates distributions (arrays) of elements.
Syntax: Origin~Spacing~Quantity
Example - Drilling Distribution:
X-offset: 0.100~0.150~8This creates 8 drillings starting at 0.100m with 0.150m spacing.
Use Cases:
Evenly spaced drillings
Connector patterns
Stud layouts
Fastener arrays
Smart Tags
Smart Tags are pre-defined process operations that can be applied to objects.
Common Smart Tags:
Perpendicular drilling (lateral position from axis)
Notches and cuts
Birds mouth connections
Custom tool paths
Connection hardware
Advantages:
Proven, tested operations
Consistent results
Easy to apply
Can be conditional
Location: %DHPKAL% directory, organized by process type
Affected Objects
When using Smart Tags or processes, specify which objects are affected:
Filter Options:
Prompt object (selected by user)
Beam types (by item number patterns)
Slices (by layer)
Distance criteria
Current element only
Example Filters:
"Beam type 621/623" (bottom/top plates)
"Distance 0.01m" (within 10mm)
"Current Wall" (only this wall)
Practical Examples
Example 1: Drilling Pattern with Maximum Spacing
Objective: Create evenly-spaced drillings along a beam where you specify the maximum spacing, and the logic block calculates the exact spacing to fit evenly.
User Inputs:
Two points (start and end)
Prompt object (beam to drill)
Maximum distance (VDistMax)
Diameter (VDia)
Reference side (VRS)
Edge distances (VX1, VX3)
Key Calculations:
# Calculate total span
VSpan = DistanceBetweenPoints - VX1 - VX3
# Calculate number of spacings needed
VNumSpaces = ROUND(VSpan / VDistMax)
# Calculate actual spacing
VDist = VSpan / VNumSpaces
# Calculate number of drillings
VNumber = VNumSpaces + 1
# Calculate first drilling position
VX2 = VX1Smart Tag Application:
First Drilling:
X-offset:
VX1Affected objects: Prompt object K1
Intermediate Drillings (using distribution):
X-offset:
VX2~VDist~VNumber-2Affected objects: Prompt object K1
Last Drilling:
X-offset:
VX3(from end)Affected objects: Prompt object K1
Example 2: Window Bottom Plate Slots
Objective: Automatically create saw slots in the bottom plate within door openings for later removal on site.
Logic Block Type: For windows/doors
Configuration:
Info Settings:
Object mode: All
Opening type: All
Shape: All
Refresh after construction: Yes
Insertion:
Slice: 0
Reference Edge: Bottom edge of opening
Insert at opening side: Left
Smart Tags (slots):
X-offset: 0 (left side)
X-offset: OB-0.01 (right side, using Opening Width system variable)
Y-offset: 0
Z-offset: 0
Affected objects:
Beam types 621/623 (bottom plates)
Current wall
Distance 0.01m
Result: When you place a door, two slots automatically appear at the edges of the bottom plate.
Example 3: X-Fix Connector Distribution
Objective: Automatically distribute X-Fix connectors along component joints based on specified spacing rules.
User Inputs:
Two points (defining the connection line)
Edge distances (start and end)
Maximum field spacing
Connector depth
Process:
Logic block calculates total connection length
Determines number of connectors needed based on max spacing
Calculates actual equal spacing
Creates tool paths for connector recesses
Automatically detects orientation and affected objects
Key Feature: Uses the new Tool Paths technology for flexible, machine-compatible processing.
Logic Block Organization and Management
Directory Structure
System Logic Blocks: %DHPKOL%
Provided by Dietrich's
Updated with software versions
Organized by function (Windows, Construction, etc.)
Do not modify - copy to user directory instead
User Logic Blocks: %DHPKOL%\Custom or separate user directory
Your custom logic blocks
Company-specific elements
Modified versions of system blocks
Project-specific blocks
File Management Best Practices
Create a Clear Hierarchy
User_Logic_Blocks/ ├── Company_Standard/ │ ├── Connections/ │ ├── Details/ │ └── Processes/ ├── Project_Specific/ └── Development/Use Descriptive Names
Brace_Diagonal_TBeam_Rod.ksz✓LB001.ksz✗
Keep Libraries Organized
Store library files (.gbi) with related logic blocks
Use meaningful library position numbers
Document what's stored at each position
Version Control
Add version numbers or dates to file names when creating variations
Keep a changelog for complex logic blocks
Test thoroughly before replacing production versions
Copying Logic Blocks
Important: Always use the mouse-right functions to copy logic blocks:
Right-click on a logic block in the file browser
Select "Copy with linked data"
Navigate to destination
Paste
This ensures all related files (.gbi, .psl, .btz, images) are copied together.
Getting Help
When Logic Blocks Don't Work:
Check the Control File
Location:
%DHPTMP%/KOLVariablen.logShows all variables and calculations
Identifies where calculations failed (results = 0)
Verify File Locations
Are all linked files (.gbi, .psl) in the correct location?
Do file paths in the logic block match actual locations?
Check Variable Names
Are all variables used in calculations defined?
Are variable names spelled correctly?
Test Incrementally
Start with minimum elements
Add complexity gradually
Test after each addition
Review Conditions
Are conditions preventing elements from appearing?
Try temporarily removing conditions to isolate issues
Logic Block Best Practices
Design Philosophy
Start Simple
Get basic functionality working first
Add features incrementally
Test thoroughly at each stage
Think About the User
Minimize required inputs
Use sensible default values
Provide clear help images
Write descriptive variable names
Calculate Once, Use Everywhere
Perform calculations in one place
Reference calculated values throughout
Don't repeat complex formulas
Plan for Flexibility
Use variables instead of hard-coded values
Add conditions for different scenarios
Design for multiple use cases
Performance Considerations
Speed Optimization (from V21.02+ updates):
Logic blocks with referenced query bodies and smart tags execute up to 30% faster
Component selection organization improved for instant function starts
Large projects with many logic blocks benefit most
Memory Optimization (from V22.01+ updates):
New Do-Undo strategy reduces memory requirements enormously
Especially beneficial for projects with many logic blocks
Allows more Do-Undo steps
Reduces delays in function calls
Best Practices for Speed:
Use conditions to prevent unnecessary calculations
Minimize complex formulas where possible
Reference system variables efficiently
Avoid redundant object creation
Testing and Validation
Before Deploying:
Test Edge Cases
Minimum and maximum values
Zero values where applicable
Negative numbers (if relevant)
Very large/small dimensions
Test in Different Contexts
Various wall thicknesses
Different module combinations
With different system settings
Verify Outputs
Check single beam information
Review material lists
Inspect machine files
Generate drawings
User Testing
Have colleagues test before wide release
Collect feedback on usability
Document common questions
Troubleshooting Common Issues
Issue: Logic Block Won't Insert
Possible Causes:
Wrong Module - Logic block type doesn't match current module
Solution: Check type in logic block info, use correct module
Missing Files - Linked .gbi or .psl files not found
Solution: Check file paths, copy missing files to correct location
Incompatible Settings - System settings conflict with logic block
Solution: Review logic block requirements, adjust settings
Issue: Elements Appear in Wrong Location
Possible Causes:
Coordinate System Confusion - Using global instead of insertion CS
Solution: Review coordinate system definitions, use relative coordinates
Incorrect Slice - Element inserted in wrong layer
Solution: Verify slice settings in object definitions
Missing Offset Calculations - Positions not adjusted for slice thickness
Solution: Add Lp0/2 or similar offsets where needed
Issue: Calculations Return Zero
Possible Causes:
Undefined Variables - Using variable before it's defined
Solution: Check calculation order, define variables before use
Division by Zero - Calculation attempts to divide by zero
Solution: Add conditional checks, ensure divisor is never zero
Incorrect Syntax - Formula has syntax errors
Solution: Review formula carefully, check parentheses, operators
Failed Condition - Condition in calculation evaluated to false
Solution: Check calculation conditions, verify they can be met
Debugging Tool: Always check %DHPTMP%/KOLVariablen.log to see exactly what happened.
Issue: Objects Overlap or Interfere
Possible Causes:
Incorrect Dimensions - Objects sized wrong for space
Solution: Review dimension calculations, test with different inputs
Position Conflicts - Multiple objects placed at same location
Solution: Review position calculations, add offset variables
Missing Processes - Objects should have notches/cuts but don't
Solution: Verify smart tag application, check affected objects filter
Issue: Logic Block Slows Down Project
Possible Causes:
Too Many Instances - Hundreds of copies of complex logic block
Solution: Simplify logic block, remove unnecessary elements
Complex Calculations - Heavy formulas executed repeatedly
Solution: Optimize calculations, cache intermediate results
Excessive Smart Tags - Too many process operations
Solution: Combine operations where possible, use conditions to limit execution
Conclusion
Logic Blocks are a powerful tool for automation in Dietrich's software. They:
Save significant time on repetitive tasks
Ensure consistency across projects
Reduce errors through automation
Enable flexibility with parametric design
Scale with your needs from simple to complex
Next Steps
Practice with existing logic blocks - Build familiarity with how they work
Start simple - Create basic logic blocks before attempting complex ones
Learn incrementally - Follow the learning path outlined in this guide
Experiment freely - Test ideas in practice projects
Seek help when needed - Use documentation, forums, and colleagues
Share your knowledge - Help others learn as you progress
Remember
The best way to learn logic blocks is through hands-on practice. Start with the examples in this guide, experiment with variations, and gradually build complexity as your understanding grows.
Document Version: 1.0 Last Updated: November 2024 Based on: Dietrich's Software V23.01 and earlier versions
For the most current information, always refer to the official Dietrich's documentation and update notes at docs.dietrichs.com.
Last updated
Was this helpful?
