- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
Noob here...
I've tried to find the solution to my problem for the better part of the weekend, but seem unable to find it, or any clues.
This is the situation:
A collegue of mine, who is sadly no longer my collegue, wrote a piece of code that clean up a dxf-file exported by revit. The cleaned-up dxf-file is used by a laser to project lines on a floor-frame that is build in the factory.
My ex-collegue was asked to tranfer the code, and the basis knowledge of changing it, to me.
This was two months ago.
Last week i was tasked with added and tweaking some of the code, but i cant seem te add lines of code to the lsp-file in the visual studio application.
what happens is this:
1. I load the code in VS
2. I start debugging and connect it to a dxf file that is opened in autocad 2022
3a. the original code runs, without problems
3b. the code that had added lines gives the following error 'no function definition: DML_HERNOEM'
the function DML_HERNOEM does exist, it ran without my code additions.
this might be a hint: the DML_HERNOEM is the first function that is called in the main function.
both the main function and the funtion that 'doesn't exist' are given below.
any help would be much appreciated. thank you!!
(defun c:DML_vloeraanzicht (#type# /) ;functie vraagt 1 tekst variabele aanroep b.v. (c:DML_vloeraanzicht "K21")(c:DML_vloeraanzicht "OPG")
(command "undo" "begin")
(setvar "cmdecho" 0)
(setq #DML_snap# (getvar "osmode"))
(setvar "osmode" 0)
(setq #hoogte_bakje# 0) ;hoogte bakje op de vloer
(DML_HERNOEM) ;hernoemen van lagen THIS IS WHERE THE ERROR OCCURS
(DML_zetvloerwaardes) ;haalt de juiste hoogte waardes op aan de hand van het ingegeven type
(DML_tekststijl) ;stel de tekststijl in en wijzig alle bestaande teksten naar deze stijl
(DML_minmax) ;bepaal de linker onderhoek van de hoekkolommen
(DML_lijnen) ;teken de lijnen door de vier hoeken
(DML_verplaats -100 -100) ;verplaats de selectie naar het 0,0 coördinaat
(command "zoom" "extents") ;test voor SJAAK KAN UIT BIJ LIVE ZETTEN
(DML_verwijder_vloerobjecten) ;verwijder objecten en hun lagen die we niet willen projecteren
(DML_unitnummer_vloeraanzicht) ;zet de unit nummer in de linker onderhoek
(DML_rotate) ;draai de unit 90°
(DML_Laad_Blok) ;controleer of de eind blokken van de binnenwanden geladen zijn
(DML_vind_muur_lijnen) ;ga op zoek naar de lijnen van de binnenwanden
(DML_verschuif_Z) ;functie die de diversen lagen naar de juiste Z waardes opschuift
(DML_Overkill) ;voegt lijnen etc samen
(DML_hernoem_Laag) ;functie voor het hernoemen van de lagen voor naar gelang het bouwsysteem
(DML_purge) ;opschonen van de tekening
(DML_verplaats_nulpunt -217 +15) ;Correctie om de units t.o.v. het 0,0 coördinaat van de laser te verplaatsen
(command "zoom" "extents")
(setvar "osmode" #DML_snap#)
(setvar "cmdecho" 1)
(command "undo" "end")
(command "saveas" "dxf" "16" "" "Y") ;het bestand opslaan als DXF en overschrijven bestaand
(princ) ;schoon afsluiten
);einde functie DML_vloeraanzicht
(defun DML_HERNOEM () ;functie voor het hernoemen van lagen
;eerste deel maakt laag aan indien deze niet bestaat, 2e deel hernoemt de laag
(command "-layer" "make" "28_Wanden_STR1_Exterior" "")
(command "-rename" "Layer" "28_Wanden_STR1_Exterior" "02_Exterior_STR1")
(command "-layer" "make" "28_Wanden_STR2_Exterior" "")
(command "-rename" "Layer" "28_Wanden_STR2_Exterior" "02_Exterior_STR2")
(command "-layer" "make" "28_Wanden_STR1_Interior" "")
(command "-rename" "Layer" "28_Wanden_STR1_Interior" "03_Interior_STR1")
(command "-layer" "make" "28_Wanden_STR2_Interior" "")
(command "-rename" "Layer" "28_Wanden_STR2_Interior" "03_Interior_STR2")
(command "-layer" "make" "01_Binnenwanden" "Color" 40 "" "") ;op deze laag worden de nieuwe binnenwanden getekend
(command "-layer" "make" "01_Binnenwanden_start" "Color" 70 "" "") ;op deze laag worden de wand blokken geplaatst
(command "-layer" "set" "0" "") ;zorgt ervoor dat laag 0 weer actief wordt
) ;einde functie DML_hernoem
Solved! Go to Solution.