Thank you for the comment, but the export process doesn't seem to be the problem.
I finally found a solution! It took me so long because there is absolutely NO info on Google about that. So, I'll leave it here:
(command "-hyperlink" "_I" "_O" (ssname selset i) "" "" (strcat "," val) val)
That goes into a loop. SELSET is the selection set containing all blocks I want to add hyperlinks to; I is the incremental value for the loop; and VAL is the name of the layout.
But that is SUPER cool. Now all my section marks are linked to layouts, so I can just click any section mark in the PDF and it flies to the page where they are, as Revit does natively.
Some weirdness I found in that matter:
- You need that comma to refer to a layout. Then, Autocad for some reason adds a hashtag sign to the URL.
- The SETURL Lisp command doesn't work, for some reason. If I want to link to, say, layout P2, and I add a hyperlink to ",P2" it throws an error saying "Hyperlink destination cannot be found".
- I also tried adding a hyperlink via VLA-ADD, but I couldn't make that work either. Same example... it created a hyperlink to ",P2" but when clicking it just opens the dwg file's folder. Weirdly, if you open the hyperlink dialog box on that object after that, and just click Ok without changing any parameter, the hyperlink suddently works.
- And I also found this guy from 2008 that had the exact same problem, in his case in VBA.